0% found this document useful (0 votes)
37 views11 pages

SAS Learnings

This document provides an overview of key SAS terminology and procedures for reading, manipulating, and exporting data. It compares formats and informats, and discusses SQL vs SAS. Common procedures covered include PROC CONTENTS, PROC FREQ, PROC SQL, DATA SET, PROC IMPORT, and PROC EXPORT. Important SAS functions like INTNX, STRIP, PROPCASE, and COMPBL are also summarized.

Uploaded by

Jaffrey Joy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views11 pages

SAS Learnings

This document provides an overview of key SAS terminology and procedures for reading, manipulating, and exporting data. It compares formats and informats, and discusses SQL vs SAS. Common procedures covered include PROC CONTENTS, PROC FREQ, PROC SQL, DATA SET, PROC IMPORT, and PROC EXPORT. Important SAS functions like INTNX, STRIP, PROPCASE, and COMPBL are also summarized.

Uploaded by

Jaffrey Joy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

FORMAT v/s INFORMAT

If informats are instructions for reading data, then you can view formats as instructions for outputting
data. Using the data provided above, we will review how to use some formats that SAS provides
SQL vs SAS
TERMINOLOGY

OUTOBS (Alternative for LIMIT)


CALCULATED (use calculated values as variables in
the same query)

LABEL (Alternative for AS)


CASE WHEN
INOBS vs OUTOBS
NMISS() – No of MISSING VALUES (counting NULL
values)
KEEP and DROP (for explicitly including or
excluding columns aka variables from getting
added into a table that is being created using data
from another table)
PROC CONTENTS
proc contents data=dataset_name [varnum];
varnum – shows list of variables added in the order it was created and not in the
alphabetical order which is the default result.

PROC FREQ
proc freq data=dataset_name;
table variable_one variable_two …;
run;

PROC SQL
proc sql;
sql_syntax…;
quit;

DATA SET
data destination_dataset_name;
set source_dataset_name;
logic…;
run;
PROC IMPORT
proc import;
datafile = “location_of_file_to_be_imported”
dbms = “filetype”
out = “dataset_to_store_data_imported”
replace;
getnames=yes; (in case of excel files to set first row as
variable names)
run;

PROC EXPORT
proc import;
data = “dataset_to_store_data_exported”
outfile = “location_of_file_to_be_exported_to”
dbms = “filetype”
replace;
run;
IMPORTANT FUNCTIONS in SAS

INTNX(‘DAY/MONTH/YEAR’, START_DATE,INTERVAL_DURATION, ’B’/’E’)


 Gives the resultant date based on the starting date and
interval duration given
 Interval duration can be negative
 The last argument ‘B’/’E’ which is optional gives the
starting or the ending date of the resultant date’s month
if the interval_type i.e. (day/month/year) was month.

STRIP(‘ STRING WITH LEADING AND/OR TRAILING SPACES ’)


 ‘STRING WITH LEADING AND/OR TRAILING SPACES’

PROPCASE(‘FDfdv fdgs dgs’)


 ‘Fdfdv Fdgs Dgs’

COMPBL(‘STRING WITH MULTIPLE SPACES IN BETWEEN WORDS’)


 ‘STRING WITH MULTIPLE SPACES IN BETWEEN WORDS’

You might also like