DATA Step, Macro, Functions and more

Printing trailing zeros on file

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 14
Accepted Solution

Printing trailing zeros on file

In my mainframe file I have one numeric field 00000008431.00, I want to print as it is on my file using SAS but no informat in my knowledge is doing that.

 

Used ZD15.2 (No luck); PD (I want values in normal display format); 15.2 (It is printing without zeros i.e. 8431.00).

 

Which informat will be useful for this?

 

           Input                    Desired Output

00000008431.00          00000008431.00


Accepted Solutions
Solution
‎03-12-2018 09:53 AM
Super Contributor
Posts: 331

Re: Printing trailing zeros on file

Hello,

 

informats are for reading values.

Use formats to control how your output is displayed.

 

data have;
informat x 14.2;
format x z14.2;
input x;

put x;

cards;
00000008431.00
;
run;

 

View solution in original post


All Replies
Solution
‎03-12-2018 09:53 AM
Super Contributor
Posts: 331

Re: Printing trailing zeros on file

Hello,

 

informats are for reading values.

Use formats to control how your output is displayed.

 

data have;
informat x 14.2;
format x z14.2;
input x;

put x;

cards;
00000008431.00
;
run;

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 101 views
  • 0 likes
  • 2 in conversation