Base SAS Programming – Day 8

Functions in SAS (Continued)

  1. Text Functions
    • Catx – to concatenate characters / strings with any delimiter. Cat is also a function used to concatenate characters / strings
    • Trim – to remove trailing blanks in a string
    • Tranwrd – Replaces all occurrences of a substring in a character string
    • Translate – Replaces specific characters in a character expression.
    • Do check out Compress and other Text functions like Upcase, Lowcase and Propcase
  2. Date and Time Functions
    • Day – Returns the Day from a SAS date value
    • Month – Returns the Month from a SAS date value
    • Year – Returns the year from a SAS date value
    • Week – Returns the week number from a SAS date value (Try weekday function)
    • Mdy – Concatenates Month, Day and year into a date value
    • Today – Returns current system date
    • Datdif – Difference between 2 dates in days
    • Yeardif – Difference between 2 dates in years
    • INTCK – Returns the number of interval boundaries of a given kind that lie between 2 dates.
    • INTNX – Increments a date value by a given time interval, and returns a date

Comments


One thought on “Base SAS Programming – Day 8

Leave a Reply

Your email address will not be published.