Date: Fri, 17 Mar 2006 16:17:24 -0500
Reply-To: Venky Chakravarthy <swovcc@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Venky Chakravarthy <swovcc@HOTMAIL.COM>
Subject: Re: Output Issues
Looks like you are getting close.
For the first question, remember that since you are writing to a text file,
no matter what your input data types are, the output is going to be text. So
you don't have to stick to the defined lengths. The pointers are more
important and there are many ways of doing it (see below for an example).
For the second part you are not getting past the 256 default Logical Record
Length (LRECL). You have to specify that option on the filename statement as
below. Assuming you are working with a post 6.12 version the below example
highlights that as well. Finally, you can choose to view the output file in
any other way, but I have shown Proc Fslist here as it is now part of Base
SAS. Something additional for you to catch up with.
Good luck with the deadline.
filename junk "\\client\c$\test\junk.txt" ;
data test ;
format x dollar27.2 ;
something = "abc" ;
x = 12346589012345678901234.25 ;
other = "junk" ;
more = 297453458 ;
data _null_ ;
set test ;
file junk lrecl = 32767 ; /* the default is 256 */
put something 1-3
@5 x dollar27.2
proc fslist file = junk ;
On Fri, 17 Mar 2006 12:35:07 -0800, The_Grudge <BarberD@GMAIL.COM> wrote:
>Sorry for littering the board today, I'm rusty and I'm on a deadline.
>I have the following code to output my data to a text file.
>File "Z:\Information Analysis & Distribution\Projects\Shadow
>Billing\Electronic Data\David's SAS Program\SAS Results\Output.txt"
> Put @01 IPOP $1.
> @02 Cr_Number $7.
> @09 PatientLastName $25.
> @34 PatientFirstName $15.
> @49 BDate yymmddn8.
> @57 Sex $2.
> @59 Street_Address $50.
> @109 City $20.
> @129 State $3.
> @132 Country $15.
> @147 Mailing_Code $9.
> @156 HCN $10.
> @166 Version $2.
> @168 HCNExpireDate
> @172 Service_Date $8.
> @180 ServiceTime $4.
> @184 InstitutionFrom $4.
> @188 Doc_Num $5.
> @194 Institution
> @198 PCSVisitNum $12.
> @210 OutofProvHealth $12.
> @222 Fee $5.
> @227 Units $5.
> @232 Index
> @235 Dx
> @239 Ref_Prov_Num $6.
> @245 Ref_Lab_Num $4.
> @249 Location $4.
> @253 PaymentProg $1.
> @254 FeeSubmitted ;
>I have two questions. Obviously I'm specifying the length of my
>character variables, but how do I specify the length for the
>currency/numeric values? For example, my last value is "Fee Submitted"
>so I need to give it the format of "Dollar27.2" but set it's length to
>8 characters in the text file.
>Also, everything in the output file looks great until I add the last
>line "@254 FeeSubmitted;"
>At the point SAS writes data to a new line in my text file rather than
>continung with new columns. How do I fix this/