Hi Brittany if someone supplies a name of dataset ( which is existing in sas environment) in the conditional expression of if statement then what will be interpreted by sas?
Hi Dev! Unless you were using the EXIST function, it would be rare to use the NAME of a SAS data set in a regular DATA step IF condition. Typically, you are using the NAME of a dataset within a SAS Macro program in order to conditionally execute code, using a SAS Macro %IF condition, as shown in this Tech Support note: 2.sas.com/60583PLfn . Unless you are using a pre-defined library, you would, of course, need a LIBNAME statement for the SAS library and you'd need to refer to the dataset correctly with the 2-level name in your code. If the dataset was in the WORK library, the SASUSER or SASHELP libraries, then you would not need to use a LIBNAME statement. We can't post code or screen shots in this feedback area and using the NAME of a data set inside a Macro program %IF condition falls outside the scope of this video topic. You should be able to use the code posted in the Tech Support note to experiment with the concept of using a dataset NAME conditionally. === ===
Awesome, session Brittany.
Thank you Brittany. Exactly what I was looking for.
Awesome !
We're glad you enjoyed it 😀
Hi Brittany
if someone supplies a name of dataset ( which is existing in sas environment) in the conditional expression of if statement then what will be interpreted by sas?
Dev, thank you for your inquiry! We are checking on this for you!
Hi Dev!
Unless you were using the EXIST function, it would be rare to use the NAME of a SAS data set in a regular DATA step IF condition. Typically, you are using the NAME of a dataset within a SAS Macro program in order to conditionally execute code, using a SAS Macro %IF condition, as shown in this Tech Support note: 2.sas.com/60583PLfn . Unless you are using a pre-defined library, you would, of course, need a LIBNAME statement for the SAS library and you'd need to refer to the dataset correctly with the 2-level name in your code. If the dataset was in the WORK library, the SASUSER or SASHELP libraries, then you would not need to use a LIBNAME statement. We can't post code or screen shots in this feedback area and using the NAME of a data set inside a Macro program %IF condition falls outside the scope of this video topic. You should be able to use the code posted in the Tech Support note to experiment with the concept of using a dataset NAME conditionally.
=== ===