Lecture6 - The RENAME= Data Set Option The RENAME= data set...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
1 The RENAME= Data Set Option The RENAME= data set option changes the name of a variable. General form of the RENAME= data set option: The RENAME= option must be specified in parentheses immediately after the appropriate SAS data set name. If the RENAME= option is associated with an input data set in the SET statement, the action applies to the data set that is being read. SAS-data-set (RENAME = ( old-name-1 = new-name-1 old-name-2 = new-name-2 ... old-name-n = new-name-n ) )
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 The RENAME= Data Set Option SET statement examples: set EmpsCN(rename=(Country=Region)) EmpsJP; set EmpsCN(rename=(First=Fname Country=Region)) EmpsJP(rename=(First=Fname)); set EmpsCN EmpsJP(rename=(Region=Country));
Background image of page 2
3 Compilation EmpsJP First Gender Region Cho F Japan Tomi M Japan EmpsCN First Gender Country Chang M China Li M China Ming F China p110d03 ... data EmpsAll2; set EmpsCN EmpsJP(rename=(Region=Country); run; PDV First Gender Country
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Compilation EmpsJP First Gender Region Cho F Japan Tomi M Japan EmpsCN First Gender Country Chang M China Li M China Ming F China ... data EmpsAll2; run; PDV First Gender Country
Background image of page 4
5 Compilation EmpsJP First Gender Region Cho F Japan Tomi M Japan EmpsCN First Gender Country Chang M China Li M China Ming F China ... data EmpsAll2; run; PDV First Gender Country
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Compilation EmpsJP First Gender Region Cho F Japan Tomi M Japan EmpsCN First Gender Country Chang M China Li M China Ming F China ... data EmpsAll2; run; PDV First Gender Country
Background image of page 6
7 Compilation EmpsJP First Gender Region Cho F Japan Tomi M Japan EmpsCN First Gender Country Chang M China Li M China Ming F China data EmpsAll2; run; PDV First Gender Country ...
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 EmpsAll2 First Gender Country Chang M China Li M China Ming F China Cho F Japan Tomi M Japan Final Results
Background image of page 8
9 APPEND Procedure versus SET Statement The data set that results from concatenating two data sets with the SET statement is the same data set that results from concatenating them with the APPEND procedure if the two data sets contain the same variables. The APPEND procedure concatenates much faster than the SET statement because the APPEND procedure does not process the observations from the BASE= data set. The two methods are significantly different when the variables differ between data sets.
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
10 Criterion APPEND Procedure SET Statement Number of data sets that you can concatenate Uses two data sets. Uses any number of data sets. Handling of data sets that contain different variables Uses all variables in the BASE= data set and assigns missing values to observations from the DATA= data set where appropriate. Cannot include variables found only in the DATA= data set. Uses all variables and assigns missing values where appropriate. APPEND Procedure versus SET Statement
Background image of page 10
11 Quiz Which method would you use if you wanted to create a new variable at the time of concatenation?
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 235

Lecture6 - The RENAME= Data Set Option The RENAME= data set...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online