0% found this document useful (0 votes)
52 views1 page

Proc Datasets

The document discusses various statements that can be used in the PROC DATASETS procedure in SAS. The KILL statement deletes all data sets within a specified library. The CONTENTS statement provides information about the variables within a SAS library. The APPEND statement combines two datasets, adding the data from one dataset to another. The DELETE statement removes a specified dataset. The MODIFY statement modifies attributes of a dataset like the label. The LABEL statement changes or adds variable labels. The RENAME statement renames variables and changes associated labels and indexes.

Uploaded by

lanka.cnu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views1 page

Proc Datasets

The document discusses various statements that can be used in the PROC DATASETS procedure in SAS. The KILL statement deletes all data sets within a specified library. The CONTENTS statement provides information about the variables within a SAS library. The APPEND statement combines two datasets, adding the data from one dataset to another. The DELETE statement removes a specified dataset. The MODIFY statement modifies attributes of a dataset like the label. The LABEL statement changes or adds variable labels. The RENAME statement renames variables and changes associated labels and indexes.

Uploaded by

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

The general form of the DATASETS statement is:

PROC DATASETS LIBRARY=LIBREF MEMTYPE=MEM-LIST <OPTIONS>;


KILL deletes all data sets within a library automatically. The general form is:
proc datasets library=mylib memtype=data
kill;
Caution: KILL executes immediately before the DATASETS procedure completes processing

THE CONTENTS STATEMENT


The CONTENTS statement acts the same as the CONTENTS procedure. This statement gives you information about the
variables within a SAS library
proc datasets library=mylib memtype=data;
contents data=securedloans;
run; quit;

THE APPEND STATEMENT


proc datasets library=mylib memtype=data;
append base=securedloans data=mortgages;
contents data=securedloans;
run; quit;

THE DELETE STATEMENT


proc datasets library=mylib memtype=data;
append base=securedloans data=mortgages;
delete mortgages;
contents data=securedloans;
run; quit;

THE MODIFY STATEMENT


proc datasets library=mylib memtype=data;
modify securedloans(label='Secured Loans');
contents data=securedloans;
run; quit;
THE LABEL STATEMENT
proc datasets library=mylib memtype=data;
modify securedloans(label='Secured Loans');
label accno='Account Number'
cct_no='Cost Center';
modify plus (label='Plus Customers');
label acct='Account Number'
cost='Cost Center';
contents data=securedloans;
run;quit
THE RENAME STATEMENT
proc datasets library=mylib memtype=data;
modify securedloans(label='Secured Loans');
index create accno cct_no;
rename accno=accountnumber
cct_no=costcenter;
label accountnumber='Account Number'
costcenter='Cost Center';
modify plus (label='Plus Customers');
index create account companycost;
rename account=accountnumber
companycost=costcenter;
label accountnumber='Account Number'
costcenter='Cost Center';
contents data=securedloans;
run;quit;

You might also like