As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I am having some issues getting a field out of a table and into a variable.
I have the below:
TABLE FILE COUNTRY
SUM
DST.COUNTRY_NM
COMPUTE ROWID/I4=LAST ROWID+1;
BY COUNTRY_NM NOPRINT
ON TABLE HOLD AS CNTRY1
END
TABLE FILE CNTRY1
PRINT
COUNTRY_NM AS 'CNTRY'
WHERE ROWID EQ '2';
ON TABLE HOLD AS CNTRY FORMAT ALPHA
END
-RUN
-READ CNTRY = &CNTRY.A128
-TYPE &CNTRY
This code should return Germany, but for some reason it is returning 000007Germany.
Why one more hold file just to add a filter on calculated field. Make use of WHERE TOTAL phrase
TABLE FILE COUNTRY
SUM
COMPUTE ROWID/I4=LAST ROWID+1;
BY COUNTRY_NM
WHERE TOTAL ROWID EQ 2;
ON TABLE HOLD
END
-RUN
-READ HOLD &CNTRY.A128
-TYPE &CNTRY
Don't have access to reporting server to test this code. But this should help you to get an idea. Hope this helps.This message has been edited. Last edited by: Ram Prasad E,
Thanks. That seemed to work until I tried using that variable later on. I am eventually using that variable in a WHERE in another table file. For some reason, when it gets there, there is some extra characters in it, it is coming out as '? USA' instead of 'USA'. The ? is some random non printable character
Cody, "ON TABLE HOLD" is creating a file in BINARY format so the ? you are getting is due to a number in there (000003 for USA) that is rendered as non-printable due to its internal representation.
Can you try some different approach to see if it works? I'll leave the ROWID manipulation for you to play with for the sake of simplicity!
TABLE FILE COUNTRY
SUM
COMPUTE DST_COUNTRY_NM/A128 = DST.COUNTRY_NM;
BY COUNTRY_NM NOPRINT
BY TOTAL DST_COUNTRY_NM
ON TABLE HOLD AS CNTRY1 FORMAT ALPHA
END
-RUN
-READ CNTRY1 &CNTRY.A128.
-TYPE &CNTRY
Well, I am getting closer. It all seems right now except there seems to be a space after the country name when I try to use it in the next table where statement.
It certainly is not the ideal solution, but in my where clause I now have WHERE COUNTRY_NM||' ' EQ '&CNTRY'; and it seems to be workingThis message has been edited. Last edited by: Cody,
The garbage is the result of reading more charater then the table is writing. I always add lots of blanks to pad the end of a TABLE request so I don't have to size my read perfectly to the length of the TABLE output. I would code this TABLE something like this:
TABLE FILE CNTRY1 PRINT COUNTRY_NM AS 'CNTRY'
COMPUTE PAD/A256 = ' ';
WHERE ROWID EQ '2'; ON TABLE HOLD AS CNTRY FORMAT ALPHA END
Jim Morrow Web Focus 7.6.10 under Windows 2003 MVS 7.3.3