How do I CREATE an external dataset with sas code?

I would like to create within a sascode a non-exsistent
textfile on the host.
So I am not forced to create the file befor filling it.

Answer Posted / kumar

/*this is only for txt file*/
data _null_;
file print;
if _n_=1 then do;
put @5'name1'@10 name2';
put @5name1 @10name2;
end;

and for excel file

file kala dde 'path.xls';
data l;
infile kala;
input name1 name2;
run;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe a time when you were really stuck on a problem and how you solved it?

2086


What does the trace option do?

666


What will calendar procedure do?

599


How does SAS handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, PROCs?

1098


Describe a time when you were really stuck on a problem and how you solved it?

2205






How can you create a macro variable with in data step? : sas-macro

576


for what purpose would you use the retain statement? : Sas programming

585


Mention few capabilities of sas framework.

693


What are the difference between sas functions and procedures?

640


How would you define the end of a macro?

704


Intern stastical programmer written test

288


I have a dataset concat having variable a b & c. How to rename a b to e & f?

580


what is data governance? : Sas-di

625


What function CATX syntax does?

689


what are some good sas programming practices for processing very large data sets? : Sas programming

511