libname temp ‘abc.sds.as’; data temp.X1; set sasuser.X2; run; Which is the correct statement??
-
In datastep input is read from temporary location and output is written to temporary location.
-
.) In datastep input is read from permanent location and output is written to temporary location.
-
In datastep input is read from temporary location and output is written to permanent location.
-
In datastep input is read from permanent location and output is written to permanent location.
The code reads from sasuser.X2 (a permanent library) and writes to temp.X1 in 'abc.sds.as' (also a permanent location, as indicated by the libname statement). Therefore, both input is read from a permanent location and output is written to a permanent location.
To answer this question, let's go through each option to understand why it is correct or incorrect:
Option A) In datastep input is read from temporary location and output is written to temporary location.
This option is incorrect because the LIBNAME statement libname temp ‘abc.sds.as’; specifies the library temp as a permanent location, not a temporary location.
Option B) In datastep input is read from permanent location and output is written to temporary location.
This option is incorrect because the LIBNAME statement libname temp ‘abc.sds.as’; specifies the library temp as a permanent location, not a temporary location. Additionally, the output dataset temp.X1 is stored in the library temp, which is a permanent location.
Option C) In datastep input is read from temporary location and output is written to permanent location.
This option is incorrect because the LIBNAME statement libname temp ‘abc.sds.as’; specifies the library temp as a permanent location, not a temporary location. Additionally, the output dataset temp.X1 is stored in the library temp, which is a permanent location.
Option D) In datastep input is read from permanent location and output is written to permanent location.
This option is correct because the LIBNAME statement libname temp ‘abc.sds.as’; specifies the library temp as a permanent location. The input dataset sasuser.X2 is read from a permanent location (the sasuser library), and the output dataset temp.X1 is written to a permanent location (the temp library).
The correct answer is D) In datastep input is read from permanent location and output is written to permanent location.