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

How do you use the do loop if you don’t know how many times you should execute the do loop?

1 Answers  


This entry was posted in General. Bookmark the permalink. Post a comment or leave

1 Answers   Quintiles,


There is a field containing a date. It needs to be displayed in the format "ddmonyy" if it's before 1975, "dd mon ccyy" if it's after 1985, and as 'Disco Years' if it's between 1975 and 1985. How would you accomplish this in data step code? Using only PROC FORMAT

8 Answers   D&B,


Are you involved in writing the inferential analysis plan? Tables specfications?

1 Answers   Wipro,


what is the primary variable in your study?

3 Answers   Accenture,


How to create a permanent sas data set?

1 Answers  


how can you sort the dataset having millions of OBS(instead of sort procedure?

4 Answers   EXL,


What is the difference between an informat and a format. Name three informats or formats.

6 Answers  


describe about metadata object? : Sas-di

1 Answers  


PROC SQL always ends with QUIT statement.Why cant you use RUN in PROQ SQL ?

7 Answers   HP,


What do the put and input function do?

1 Answers  


explain about various caches available in data integrator? : Sas-di

1 Answers  


Categories