DATA Step, Macro, Functions and more

print blank instead of 0

Reply
Frequent Contributor
Posts: 89

print blank instead of 0

dear all,
code below works fine on PC:
proc format ;
VALUE ZERO
0 = ' '
other = [commax15.]
;
RUN;

BUT on mainframe not the formatted value is printed but the string [commax15.]

any ideas?

Regards,
Herman
Super Contributor
Super Contributor
Posts: 3,174

Re: print blank instead of 0

Share with us some SAS-generated log output that demonstrates the behavior you are encountering, with all of your SAS code revealed (that would include a formatted PUT in a DATA or PROC step output. You will want to first desk-check to see if SAS has correctly applied your output FORMAT -- by doing a PROC CONTENTS against your SAS file. What you have shown in your post is only a piece of what is required to make the process work -- now you need to convey what SAS code that references your format is not working for you.

Scott Barry
SBBWorks, Inc.
Frequent Contributor
Posts: 89

Re: print blank instead of 0

NO errors appear in the log, format is used in proc report
Super Contributor
Super Contributor
Posts: 3,174

Re: print blank instead of 0

Okay - now share all SAS code related to the problem, which would include your PROC REPORT code, otherwise it is a guessing game (whether or not the "mainframe" is involved).

Scott Barry
SBBWorks, Inc.
Valued Guide
Posts: 2,177

Re: print blank instead of 0

Jaheuk
for me, "commax" indicates you are probably suffering a code-page issue in NLS (national language support) with the square brackets on zOS.
I don't recall clearly but in SAS6 days (where I got most of my more-recent ;-) experience of zOS-SAS) there was a work-around with iirc !( and !) or something like that. (in the last millennium!! the zOS keyboards I worked on did not support square brackets so SAS provided those alternatives.
At http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#a000205506.htm the CHARCODE system option is documented describing how characters required by syntax but not on a "keyboard", can be achieved with a ?-combination.
I was wrong about ?( and ?) That documentation shows it should be ?< and ?>

good luck
peterC
Frequent Contributor
Posts: 106

Re: print blank instead of 0

Could you post the result of a
[pre]
proc format fmtlib;
select zero;
run;
[/pre]
run on your mainframe? (In case I have the syntax wrong, the intent is to display the format definition as it was interpreted by SAS when the format was created).
Respected Advisor
Posts: 4,173

Re: print blank instead of 0

Hi

May be what you observe is related to this issue:
http://support.sas.com/kb/35/029.html

And different OS could behave different (i.e. different patch levels).

I would give the suggestions in the SAS note a go:
"A possible circumvention for this issue is to assign a width on the FORMAT statement."

HTH
Patrick Message was edited by: Patrick
Ask a Question
Discussion stats
  • 6 replies
  • 296 views
  • 0 likes
  • 5 in conversation