Hi i am having data but i wnat to export the data into text file but i want to give 3 delimeters ,how can i do it ,i have tested it but it was taking only one delimter.
proc export data=test outfile="/tmp/mydata/test.txt"
dbms=dlm replace;
delimiter='^?/';
run;
The DATA step can be used to write delimited files. Consider this step as a starting point.
data _null_;
set sashelp.class;
file "c:\temp\test.txt"
dlmstr='^?/';
put name age sex height weight;
run;
The DATA step can be used to write delimited files. Consider this step as a starting point.
data _null_;
set sashelp.class;
file "c:\temp\test.txt"
dlmstr='^?/';
put name age sex height weight;
run;
Thqs
but i am not getting the variable names if i wnat the variable names what should i do i have used put also.
This will add the variable names.
data _null_;
set sashelp.class;
file "c:\temp\test.txt"
dlmstr='^?/';
if _n_=1 then put 'name^?/age^?/sex^?/height^?/weight';
put name age sex height weight;
run;
There are DATA step solutions that do not require you to know the variable names, but they are more complicated.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.