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.

Answers were Sorted based on User's Feedback



How do I CREATE an external dataset with sas code? I would like to create within a sascode a non..

Answer / temporarypostedname

I thought about sth like this:

Data _null_;
filename fileref <device-type>
dsnname='path'

run;


something like this buy it do not work.
and i would like to add BLK, DISP; UNIT SIZE

Is This Answer Correct ?    0 Yes 0 No

How do I CREATE an external dataset with sas code? I would like to create within a sascode a non..

Answer / 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

More SAS Interview Questions

What is the Program Data Vector (PDV)? What are its functions?

5 Answers   Accenture,


What do you feel about hardcoding?

3 Answers   Pfizer,


what is PhaseIII, ODS, TLG, Macro and Proc in SAS

0 Answers  


Name statements that function at both compile and execution time.

7 Answers   Accenture,


Enlist the syntax rules followed in sas statements.

0 Answers  






Difference between nodup and nodupkey options?

0 Answers  


Why is a STOP statement needed for the point=option on a SET statement?

2 Answers   Quintiles,


Can we use where and having clauses in a single SAS program. ex: proc sql;     select a,b,c from test      where state in 'KA'      and having <some condition>. Is the above program run correctly, if not why ?     

4 Answers   UHG,


If reading an external file to produce an external file, what is the shortcut to write that record without coding every single variable on the record?

7 Answers   Accenture,


What is the function of output statement in a SAS Program?

0 Answers  


what is the difference between floor and ceil functions in sas? : Sas-administrator

0 Answers  


Explain translate function?

0 Answers  


Categories