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 have a query which pulls several columns from a master file, including a date field which may have null values, and then I pass that data to a hold table.
If I do not add a date format specification to the column when creating the hold table, the null values are preserved in the hold table. When printing the hold table you can verify the default null value of "." in the columns for certain rows.
However, if I add a date format specification such as \HYYMDI, (this is the actual format specified for the column in the master file), then the null values are NOT preserved when passing the data to the hold table. Null values no longer show up as '.' and you cannot use the MISSING keyword in where statements. Null values simply show as blank fields with no "."s. SET NODATA will also not work to rename the null date values because they cannot be found.
Can I anyone shed some light on this problem?
I have a larger, more complex procedure which passes data along several hold tables; needs to be able to evaluate null values while also specifying date formats on columns
Also, I have already tried the following commands: "SET ALL = ON", "SET COMPMISS=ON" SET MISSING = ON" SET HOLDMISS = ON" to no avail..This message has been edited. Last edited by: Kerry,
Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro
Maybe I am not understanding the issue, but in the following code null values are preserved (using WF release 7.7.03):
SET HOLDLIST = PRINTONLY
-*
DEFINE FILE CAR
SALES_DATE/HYYMDI MISSING ON = IF (COUNTRY NE 'FRANCE' OR 'JAPAN') THEN DT(&YYMD 00:00:00) ELSE MISSING ;
END
-*
TABLE FILE CAR
PRINT
COUNTRY
CAR
MODEL
SALES
SALES_DATE
ON TABLE HOLD AS HOLDX
END
-*
TABLE FILE HOLDX
PRINT
COUNTRY
CAR
MODEL
SALES
SALES_DATE/HMDYYI
ON TABLE HOLD AS HOLDY
END
-*
TABLE FILE HOLDY
PRINT *
END
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
SET HOLDLIST = PRINTONLY -* DEFINE FILE CAR SALES_DATE/HYYMDI MISSING ON = IF (COUNTRY NE 'FRANCE' OR 'JAPAN') THEN DT(&YYMD 00:00:00) ELSE MISSING ; END -* TABLE FILE CAR
BY COUNTRY BY CAR BY MODEL BY SALES BY SALES_DATE/HMDYYI ON TABLE HOLD AS HOLDX END -* TABLE FILE HOLDX
BY COUNTRY BY CAR BY MODEL BY SALES BY SALES_DATE ON TABLE HOLD AS HOLDY END -* TABLE FILE HOLDY PRINT * WHERE SALES_DATE NE MISSING END
Do you see how the nulls are not preserved?
Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro
I seem to remember that you cannot dynamically re-format fields used in BY phrases. Although an error message is not generated, this seems to be the problem. If you remove the re-format on SALES_DATE, the query works as expected:
SET HOLDLIST = PRINTONLY
-*
DEFINE FILE CAR
SALES_DATE/HYYMDI MISSING ON = IF (COUNTRY NE 'FRANCE' OR 'JAPAN') THEN DT(&YYMD 00:00:00) ELSE MISSING ;
END
-*
TABLE FILE CAR
BY COUNTRY
BY CAR
BY MODEL
BY SALES
BY SALES_DATE
ON TABLE HOLD AS HOLDX
END
-*
TABLE FILE HOLDX
BY COUNTRY
BY CAR
BY MODEL
BY SALES
BY SALES_DATE
ON TABLE HOLD AS HOLDY
END
-*
TABLE FILE HOLDY
PRINT *
WHERE SALES_DATE NE MISSING ;
END
One solution is to re-format SALES_DATE correctly as a PRINT/SUM verb object:
SET HOLDLIST = PRINTONLY
-*
DEFINE FILE CAR
SALES_DATE/HYYMDI MISSING ON = IF (COUNTRY NE 'FRANCE' OR 'JAPAN') THEN DT(&YYMD 00:00:00) ELSE MISSING ;
END
-*
TABLE FILE CAR
BY COUNTRY
BY CAR
BY MODEL
BY SALES
BY SALES_DATE
ON TABLE HOLD AS HOLDX
END
-*
TABLE FILE HOLDX
SUM FST.SALES_DATE/HMDYYI
BY COUNTRY
BY CAR
BY MODEL
BY SALES
ON TABLE HOLD AS HOLDY
END
-*
TABLE FILE HOLDY
PRINT *
WHERE SALES_DATE NE MISSING ;
END
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
Thank you for pointing that information out about dynamic reformatting and BY phrases. I will try converting all my queries to Print phrases.
However, one of the hurdles we face, is that we have a procedure that is grabbing data from 3 different sources and combining the data into one hold table. Since one of the 3 data sources has a different date format than the rest, we have to dynamically reformat it to 'HMDYYI' for the merge of all 3 hold tables to work. So I do not have the option of removing dynamic reformatting as a solution.
Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro
If sorting by the date is necessary, besides Francis' excellent DEFINE solution, you could also use PRINT/SUM to reformat the date and sort the date with a NOPRINT:
SET HOLDLIST = PRINTONLY
-*
DEFINE FILE CAR
SALES_DATE/HYYMDI MISSING ON = IF (COUNTRY NE 'FRANCE' OR 'JAPAN') THEN DT(&YYMD 00:00:00) ELSE MISSING ;
END
-*
TABLE FILE CAR
BY COUNTRY
BY CAR
BY MODEL
BY SALES
BY SALES_DATE
ON TABLE HOLD AS HOLDX
END
-*
TABLE FILE HOLDX
SUM FST.SALES_DATE/HMDYYI
BY COUNTRY
BY CAR
BY MODEL
BY SALES
BY SALES_DATE NOPRINT
ON TABLE HOLD AS HOLDY
END
-*
TABLE FILE HOLDY
PRINT *
WHERE SALES_DATE NE MISSING ;
END
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007