09-26-2011 12:54 PM
I need to export (using proc export) a data to flat file (with tilde delimiter ~ ) without header record in the output.
input name $ city $ state $;cards;
Tim orlando Florida
John jersey newjersey
Bob newyork newyork
output should be :
Please let me know
09-26-2011 01:09 PM
I am getting an error as below,
PROC EXPORT DATA= WORK.TEST
83 OUTFILE= "&drv2.\RGA14001\current\dd.dat"
84 DBMS=DLM REPLACE;
NOTE: The previous statement has been deleted.
ERROR 180-322: Statement is not valid or it is used out of proper order.
09-26-2011 01:14 PM
You just got some extra characters into your program. The error message is that it did not understand the PROC statement. So of course it does not understand the other statements that only apply when running PROC EXPORT.
09-26-2011 01:54 PM
You would have to post the code you actually submitted, including the line that assigns the macro variable, in order for anyone to figure out what the problem is. You may also have tried to run the code when something else was already running.
I would save the program, restart SAS, and then see if it works. The program itself appears to be correct.
09-27-2011 11:41 AM
I am using SAS 9.1 ...Finally i have applied this logic to get the output without header records,
File "&drv14.\test" dsd dlm='~' lrecl=32767;
Set output ;
Put ( _all_)(+0);
Thanks for all your responses.
09-27-2011 03:52 PM
Here is my solution to the same problem using PROC EXPORT and then using a DATA step after. There are so many ways of solving the same problem in SAS!
09-27-2011 06:43 PM
I am not sure why people use PROC EXPORT to create text files. The data step is in many ways easier and more flexible.
not to mention - simpler, more reliable and probably producing more dense files (only quoting when neccessary)
09-27-2011 06:46 PM
Many of us use procs import and export because we figure that SAS would have made the task easier and with more capabilties than we could have accomplished on our own. Unfortunately, that isn't always the case as we have discovered with procs import and export.
Hey, we could also accomplish building a neural net, logistic regression, or what have you in a datastep as well but, I think, most of us would simply use the procs included with Enterprise Miner and SAS/STAT.
Me thinks that your comment should be taken as a wake up call to those who are responsible for procs import and export. Some of our colleagues and I are doing a presentation at SGF2012 related to proc import, specifically about importing tables that one might copy from the web. We, too, had to build code in a datastep because proc import didn't provide the necessary capabilities. Obviously, a much better job could have been done if we had access to the actual source code.