Hello there, I want to export a sas file as csv file in the latest SAS EG Version. The table has 4 columns (number, charc, date1, date2).[number as int, charc as character, date1&date2 as date] The charc-column contains numbers from 0 to 20 (1,2,3,...,10,...15,...20) and as the table needs to the same logical record length for every row for further processing, I wanted to export all one digit numbers as 'blankNUMBER', e.g: blank0, blank1, blank2, and so on. Number;Charc;Date1;Date2 123456; 0;2019-01:2019-02 .... 123456;10;2019-01;2019-02 proc sql;
create table TABLE_1 as
select number,
case when charc lt 10 then cat(' ',charc)
else put(charc,2.)
end as charc,
date1,
date2
from TABLE_2;
quit;
filename csv "path...TABLE_1_Export.csv";
data _null_;
set TABLE_1;
file csv dlm=';';
if _n_ eq 1 then
PUT @1 'number;charc;date1;date2';
PUT number :$10.
charc :$char2.
date1 :EURDFDD10.
date2 :EURDFDD10.;
run; Unfortunately, the blank in the cat-function is not visible in the output. However, when I change the blank to a tab (by using '09'x I think) it's working, but a tabulator does not work for me. Are single blanks not possible to process while exporting to csv or am I missing sth. important in my code. Thanks in advance and have a great day, Lukas
... View more