Date: Wed, 18 Apr 2012 08:56:23 -0700
Reply-To: Daniel Nordlund <djnordlund@FRONTIER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Daniel Nordlund <djnordlund@FRONTIER.COM>
Subject: Re: creating a tab-delimited file
In-Reply-To: <201204181317.q3I4iXGk025666@waikiki.cc.uga.edu>
Content-Type: text/plain; charset="UTF-8"
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Sas
> Beginner
> Sent: Wednesday, April 18, 2012 6:17 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: creating a tab-delimited file
>
> hello.
>
> i need to send a tab-delimited file to a client with the following format:
> FieldName
>
>
> variable Width
> pracid 12
> patid 6
> doscode 8
>
> i created a sas dataset where the variables have the above lengths:
>
> # Variable Type Len Format Label
>
> 1 pracid Char 12 Practice Id
> 2 patid Char 6 Patid
> 3 doscode Char 8 Doscode
>
> note: pracid ahs a length of 12. however, the longest pracid value in this
> dataset is 5 characters long.
>
> i then run proc export:
> proc export data=z2
> outfile='y:\temp2.txt'
> dbms=tab;
> run;
>
> however, when i look at the tab-delimited text file, pracid is only 5
> characters long. is there something i can do to retain the trailing blanks
> and retain the length of 12 for pracid?
>
> many thanks.
> christine
Christine,
I am a little confused. It sounds like your client wants a fixed format file, not tab-delimited. Usually, one uses delimiters when you don't want to worry about varying lengths of the output fields. Can you clarify what it is that the client needs?
Dan
Daniel Nordlund
Bothell, WA USA
|