Focal Point
convert zero to blank
February 22, 2008, 04:31 PM
<M_RIOS75>convert zero to blank
I am having issues with this...
DEFINE FILE DBLOG
REMEST1/D12C = IF (P_FLAG EQ 'Premium') THEN REMEST0 ELSE 0;
END
This works fine.. but instead of a zero, I'd like a blank ' '. But it keeps complaining about the format...
Any help??
Marvin
February 22, 2008, 04:39 PM
FernandoMarvin,
If want null/missing try:
DEFINE FILE DBLOG
REMEST1/D12C MISSING ON= IF (P_FLAG EQ 'Premium') THEN REMEST0 ELSE MISSING;
END
Then set NA to ''
If you truly want a blank then convert the numeric column into an alpha.
Fernando
Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
February 22, 2008, 04:40 PM
LeahUse the format option to surpress zeroes.
D12S should do it as D inserts commas if my mind is working.
Leah
February 22, 2008, 04:47 PM
Darin LeeYou've already two correct answers, but to explain further, you can't just set the value to a blank because a blank is an alpha character and your expression's format is defined as numeric (D12C). It will depend on what you need it for, but you'll probably experience fewer problems by just changing the display format as Leah suggests, rather than setting the value to null. (Null values could affect averages and proper handling if used in selection criteria, among other things.)
Regards,
Darin
In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
February 24, 2008, 10:03 AM
BailleclD12C means Comma delimited.
D12CS would mean same as D12C + Zero Suppress
Cobol talking persons would say Blank When Zero.
The Missing Approach is interesting too but it has to do with
1) The Missing Attribute (Typical DB2)
2) A question of cardinality linkes to the Way a join is Established (Unique => No Missing, Join to ALL ans SET ALL = ON
3) The 'portability' of the Missing character of a Field thru Defines (Missing ON, Missing on All, etc ...)
All these aspects being strongly debated, ... in the 80'ies ...
I probably don't explain well, but I know what you mean. Perhaps I'm not (yet) such an Old Fool.
Thank you so much for reassuring me (a little)
Focus Mainframe 7.6.11
Dev Studio 7.6.11 and !!!
PC Focus, Focus for OS/2, FFW Six, MSO
February 24, 2008, 02:24 PM
FrankDutchthe DISPLAY of a field as D12CS is something else than the value in the database.
Displaying has only impact on the report, you decide to show the value or the calculation.
You can decide either that value as "0" or as "-" or as "0.0" or "NONE" or wathever you like.
It does not influence the further calculation.
If you put the result of that calculation in a database again, there will be a value of zero "0" be in the database. If you choose to display it as "NONE" there still is "0" in the database and not NULL.
|
Frank |
| prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7 |
February 25, 2008, 02:01 PM
<M_RIOS75>Thanks, I appreciate all the help. I really just needed to suppress the zeros to blanks and the D12CS is working perfect.
It was a field that would always be zero (part of more commplex report) and it was requested to have a blank in its place.