I need to know how to output data as txt pipe delimited in sas
Hi,
A web search for "how to create a delimited file site:sas.com" brought back the following:
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000316290.htm
http://support.sas.com/kb/24/596.html
They should be of help, but if you need something else then please provide more detailed information.
Regards,
Amir.
Easiest would be Proc export with DBMS=dlm and a Delimiter='|';
proc export data=sashelp.class outfile="c:\myfiles\class" dbms=dlm replace; delimiter='|'; run;
or the export wizard.
i tried this code
ods csvall file="&output\A678_20110265_irrc_recist_NL_2018Jul18.txt" options(delimiter='|');
title;
proc print data=irr_nl_1 noobs; run;
ods csvall close;
but it gave me " " in the character variables
@mona4u wrote:
i tried this code
ods csvall file="&output\A678_20110265_irrc_recist_NL_2018Jul18.txt" options(delimiter='|');
title;
proc print data=irr_nl_1 noobs; run;
ods csvall close;
but it gave me " " in the character variables
That's common in data structures, avoid having to deal with records that could have an embedded pipe symbol in it. If you don't want that you'll have to likely write a data _null_ step instead to manually export it.
I believe the links someone else provided demonstrates how to do that.
it didn't work
@mona4u wrote:
it didn't work
This is not helpful. How did it not work? What does that mean? What did you try and what errors did you get?
The code posted worked fine for me, so you likely implemented it incorrectly or have not specified your requirements in enough detail so we don't actually know what you want.
Hi,
A web search for "how to create a delimited file site:sas.com" brought back the following:
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000316290.htm
http://support.sas.com/kb/24/596.html
They should be of help, but if you need something else then please provide more detailed information.
Regards,
Amir.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.