Removing dashes and parentheses from phone numbers
Removing dashes and parentheses from phone numbers is one of the common data cleaning activities. This program uses the compress function to remove unwanted characters from a phone number. data phone_number; input Phone $ 1-20; Phone_number=compress(Phone, , 'kd'); datalines; (908)235-4490 (201) 555-77 99 ; title 'Removing dashes and parentheses from phone numbers'; proc print data=phone_number;… (0 comment)

SAS data sets consist of a descriptor portion and a data portion that contains the data values. The descriptor portion of a SAS data set holds the detailed information about the data set. This information includes: Dataset name and its ember type Creation time of the dataset The number of observations The number of variables The… (0 comment)

Sorting Orders for Numeric Variables Numeric variables are sorted from the smallest-to-largest comparison and the sequence is as below. SAS System missing values (shown as a period or special missing value) negative numeric values zero positive numeric values. Sorting Orders for Character Variables PROC SORT uses either the EBCDIC or the ASCII collating sequence when… (0 comment)

There are a number of statements, options, functions, and programming alternatives that are well suited to controlling how and when all or a portion of a program can be stopped conditionally. Sometimes we want to control the flow of the individual data steps of the program. This may include the termination of a step or even the SAS job itself. There are several exit strategies depending on the objective.… (0 comment)

How to Password protect SAS datasets ?
Password Protecting SAS datasets Password Protecting SAS datasets means using access control on your data to prevent unintended access and secure your data. SAS has provided three levels of Access controls over the data and is implemented using passwords. Those access controls are read-write and alter. Passwords are hierarchical in terms of gaining access. For… (0 comment)

PROC PRINTTO procedure is used to redirect log output and procedure output to files or printers. To save the output in an external file, specify the external file or the fileref in the PROC PRINTTO statement. Syntax: PROC PRINTTO <options>; Options in Proc Printto LABEL= It provides a description for a SAS log or procedure… (0 comment)

Proc Summary in SAS: Explained
PROC SUMMARY in SAS procedures allows us to explore our data not only in terms of counts and distributions but also statistically.  Syntax: PROC SUMMARY DATA=libref.filename options; BY (or CLASS) variable-list; ID variable-list; VAR variable-list; TYPES variable-list; WAYS n; OUTPUT OUT=libref.filename(options) output statistic=variable-list/options; RUN; Options (partial list):  👉 MISSING – Treat missing values as a… (0 comment)