I need an output in csv ,and my program is :
data_null_;
filename;
set;
file
delimiter=',' dsd 1rec1 = 350;
if_n_1 = 1
then do ;
put 'name'
'date'
'place'
'gender'
;
end;
put name
date
place
gender
;
run;
now my issue is when i open the ouput file either in excel or word pad
name date place gender
abcdef,09/09/2001,losangeles,male
how to arrange or reformat .,where there is no mention of size of variables in requiremnt .
That's what a CSV file looks like, Comma Separated Values
What format do you want to see in wordpad?
You didn't include comma's in your header column. Add comma's between the variable names and then open the file in Excel, it should look fine. If you want it to line up in columns in word pad that is NOT a CSV file, its a fixed width file format, that I would recommend avoiding.
Also, you can use proc export instead of manually writing your datastep export if you'd like.
proc export data=have outfile="mycsv.csv" dbms=csv replace; run;
http://www.ats.ucla.edu/stat/sas/faq/write_fixedformat.htm
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.