Date: Fri, 15 Feb 2002 07:15:00 -0800
Reply-To: Stephan <skrause@DVD-SYSTEMPARTNER.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Stephan <skrause@DVD-SYSTEMPARTNER.DE>
Subject: Re: Creating flat files from SAS
Content-Type: text/plain; charset=ISO-8859-1
you could solve your problem with an SCL-Program. There you can use
vartype, varlen and varname to get the metadata of your table. With
getVarC you can get all your data using fetch to walk through your
dataset. Inserting these data into a scl list and using savelist(
'file', ..., ...) you can save your list to your harddrive.
Is this of any help?
chittsk@YAHOO.COM (Siva) wrote in message news:<200202150341.g1F3fSJ08460@listserv.cc.uga.edu>...
> I have a SAS dataset that contains alpha and numeric variables. There are
> missing values in each of these variables. I would like to have a procedure
> that will create a flat file from the dataset with the following
> 1. Only the alpha variables should be isolated for output.
> 2. The first record should automatically contain the list of the alpha
> variables with a blanka s the delimiter.
> 3. The second record should be specify the width used for each variable.
> 4. The subsequent records should contain the values of the string variables
> with a variable-specific format that should be determined automatically.
> 5. If a variable value is less than the field width, it should be padded
> with trailing blanks.
> 6. If the alpha variable value is missing, a '.' should be placed in the
> flat file.
> So for ex. if the data is
> Day has values of 20 and 19
> Person has values of Steve and Sam
> Place has values of Detroit and Charlotte
> Comments has the value of MV and Yes. (MV = missing value)
> Then the SAS code should output:
> Person Place Comments
> 5 9 3
> Steve Detroit .
> Sam Charlotte Yes
> The 5, 9 and 3 in the second record because 'Steve' determines the width of
> the first column and it is 5 characters long. Similarly Charlotte
> determiens the width of the second column and it is 9 characters long.
> I am a newbie to SAS, so your help is appreciated.