Date: Fri, 6 May 2005 12:29:17 -0700
Reply-To: "Terjeson, Mark (IM&R)" <Mterjeson@RUSSELL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Terjeson, Mark (IM&R)" <Mterjeson@RUSSELL.COM>
Subject: Re: Put statement output
Content-Type: text/plain; charset="us-ascii"
You can use lots of different formats that have
different (for the lack of a better word) formats. :o)
You could change your 8. format to a zerofill format
such as z8. instead.
Hope this is helpful.
Senior Programmer Analyst, IM&R
Russell Investment Group
Global Leaders in Multi-Manager Investing
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Friday, May 06, 2005 12:24 PM
Subject: Put statement output
I have some data in SAS and I want to output it to a text file so I can
use the data in a fortan program that I have.
I am trying to use the PUT statement, but I am wondering how to add
zeros in front of numbers. If I just use
data file2;set file1;
put @1 oracle 8. @9 cowctl 7.
Example: The fortran programs requires that an id be 8 characters. But
id 1 is just one number. How do I get sas to put seven zeros in front
of it so it fills the whole column specficatoin.
1 = 00000001
I have this problem with other columns, but I may only need to add one
or two zeros in front of those numbers to fit the column specifications.
U of MN Dairy Cattle Genetics
205 Haecker Hall
1364 Eckles Ave.
St. Paul, MN 55108