I have a dataset with sixty columns and 300 observations.I would like to create a tab delimited file with out the column variables in the first row.
I used below code.But its creating a tab space at the beginning of the first column.Please suggest me a way to create a tab delimited without the variable names in the first row.
file "&fileloc/&outfile" lrecl=32760;
I was experimenting based on this post I found in the knowledge base http://support.sas.com/kb/24/843.html
and got an error message that SAS was expecting a quoted string, $, &, /, //, :, =, ?, ~ (I think that's everything.)
When I tried the $, I got the result I wanted. I tried the others too and some gave me the same results as the $ while others like / inserted a carriage return. I'm not sure exactly what's going on, but it works, so I decided to post it.
Some comments...when you use PUT (_ALL_) you are tellling SAS to write ALL of the variables from the PDV (Program Data Vector) to the output file specified on the FILE statement. When you use a PUT like this, what you can (and should) always specify is the format to use to write the variables. The ($) tells SAS to use a character format for EVERYTHING that's being written.
So in your case, the original PUT statement was never going to work:
because ('09'x) is NOT a format -- it is what you wanted to use as a delimiter and it needed to be specified in the DLM= option. With just PUT (_ALL_) and NO format list, you would have gotten this error:
1658 put (_all_);
ERROR 79-322: Expecting a (.
ERROR 76-322: Syntax error, statement will be ignored.
So the ($) made the PUT statement happy with a format to use for every variable in the PDV. And the DLM= option told SAS to use the tab as the separator.