SAS Tutorial | If-Then / Else Statements

Поділитися
Вставка
  • Опубліковано 5 лют 2025

КОМЕНТАРІ • 7

  • @AndrewNgundue
    @AndrewNgundue 10 місяців тому +1

    Awesome, session Brittany.

  • @babajara2725
    @babajara2725 Рік тому

    Thank you Brittany. Exactly what I was looking for.

  • @AV-nf8xd
    @AV-nf8xd Рік тому

    Awesome !

    • @SASUsers
      @SASUsers  Рік тому

      We're glad you enjoyed it 😀

  • @devdubey5574
    @devdubey5574 2 роки тому

    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?

    • @SASUsers
      @SASUsers  2 роки тому

      Dev, thank you for your inquiry! We are checking on this for you!

    • @SASUsers
      @SASUsers  2 роки тому

      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.
      === ===