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 accepting a date from the parameter screen as YYYYMMDD.
Since several of our DB files contain the year, and I can use that date to create the DB table names I need to access. I also wanted to use that year as an index for a loop to process several 'year' tables but after using the EDIT function to get the year I cannot do integer math.
I have tried using ATODBL to convert the edited field to a numeric value but get errors no matter what I use in the 3rd parameter
any help on a 'general strategy' for doing this would be appreciated
Code:
-DEFAULT &ST_DATE = '20100701'; -DEFAULT &END_DATE = '20100730'; -SET &START_YEAR = ATODBL(EDIT(&ST_DATE,'9999'),'04,'I4'); -* &START_YEAR IN PARAMETER 3 DOESN'T WORK EITHER (this works great in a DEFINE) -SET &END_YEAR = EDIT(&END_DATE,'9999');
-* TABLES PRIOR TO 2005 WERE A DIFFERENT FORMAT, SO 2005 IS THE EARLIEST ACCEPTABLE YEAR FOR THIS REPORT -SET &LOOP_YEAR = IF START_YEAR GE 2005 THEN START_YEAR ELSE 2005;
-LOOP1START
IF &START_YEAR GT &END_YEAR THEN GOTO LOOP1EXIT
-SET &TA_FILENAME = 'TA_'||&LOOP_YEAR; -* IF ONLY 1 YEAR TO PROCESS GIVE IT A STATIC NAME, IF MORE THAN 1 YEAR TO PROCESS WE WILL USE MATCH FILE -* TO MERGE/CONCAT SUBSEQUENT FILES INTO THE FIRST FILE -SET &TA_OUT_FILENAME = IF &LOOP_YEAR EQ &START_YEAR THEN 'TA_OUT_FILE' ELSE 'TA_'||&LOOP_YEAR||'_OUT'; -SET &TA_TABLE_NAME_ID = &TA_FILENAME||'_ID';
DEFINE FILE &TA_FILENAME ID/A7 = GETTOK(&TA_TABLE_NAME_ID,27,1,'*',7,ID); AWARD/A10 = GETTOK(&TA_TABLE_NAME_ID,27,2,'*',5,AWARD); TERM/A10 = GETTOK(&TA_TABLE_NAME_ID,27,3,'*',10,TERM); FA_AWD_FLAG/A1 = IF TA_TERM_AMOUNT GT 0 THE 'Y' ELSE 'N'; END
TABLE FILE &TA_FILENAME HANKID AWARD TERM TA_TERM_AMOUNT ON TABLE PCHOLD FORMAT HTML -*ON TABLE HOLD AS &TA_OUT_FILENAME END
-* PERFORM MERGE HERE
-* INCREMENT & RETURN TO TOP OF LOOP
-**** THIS LINE GENERATES A PARAMETER MISMATCH ***** -SET &LOOP_YEAR = &LOOP_YEAR + 1;
-GOTO LOOP1START
-LOOP1EXITThis message has been edited. Last edited by: Kerry,
WebFOCUS 7.6.9 Windows all output (Excel, HTML, PDF)
Remember, by default amper variables are just alphanumeric strings. When doing simple arithmetic using numeric strings, the results are always truncated intergers.
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006