The following SAS program is submitted:
libname rawdata1 'location of SAS data library';
filename rawdata2 'location of raw data file';
data work.testdata;
infile
input sales1 sales2;
run;
infile
input sales1 sales2;
run;
Which one of the following is needed to complete the program correctly?
A. rawdata1
B. rawdata2
C. 'rawdata1'
D. 'rawdata2'
B. rawdata2
C. 'rawdata1'
D. 'rawdata2'
6 comments:
Answer: B
The infile takes a fileref rawdata2
The file name should be within quotes rite? Shouldn't it be 'rawdata2'
Yes Harini you are right ..it must be in quotes
B, concur with guru. The key here is the filename statement. This creates what's called a fileref, which is essentially a nickname given to something, in this case a raw data file. Because the filename had quotes, the fileref does too. Don't belive me, check out this example from SAS help.
--------------------------------------
filename green 'your-input-file';
libname save 'SAS-library';
data save.vegetable;
infile green;
input lettuce cabbage broccoli;
run;
IS THERE ANY CHARACTER LIMIT FOR THE FILENAME (LE 8 CHARACTERS?). ANYTHING BEYOND 8 CHARCTERS GIVING THIS ERROR
ERROR: Invalid logical name.
ERROR: Error in the FILENAME statement.
libname libreifname 'path';
same as
filename filerefname 'path';
Post a Comment