Question-31: Can you please explain again the Proc step?

Answer: Lets have basic syntax for the PROC step

 

PROC <Proc_Name> Data = <Data_Set_name>

 

Here, both PROC and DATA are the SAS keyword. PROC statement needs a procedure name e.g. PRINT and the Data specifies the dataset on which procedure would be applied. However, “DATA=” is optional, if you don’t provide this it would take most recently generated Dataset in the same session.

 

Question-32: Can you please explain the Data step in more detail?

Answer: The basic purpose of the SAS is to analyze or process the data in some way. However, before processing the data, it should be in a proper format which SAS can understand and it is the responsibility of the DATA step to generate data in the required format from the RAW data. You can see entire flow as below

Here, raw data can be your csv file, text file or any other file, which you wanted to convert into SAS Dataset. Here first 3 block you can consider part of Data step and remaining three are the proc step.

Question-33: Data step should always be followed by proc step?

Answer: No, it is not necessary. A Data step can be followed by another Data step or Proc step. Similarly, a proc step can be followed by a Data step. In a program you can have as many Data step and proc step in any order as per the requirement.

 

Question-34: Can we create a new SAS Data set from existing SAS Data set?

Answer: Yes, you can create a new SAS Data set from the existing SAS data set. Which can be done using the various SAS statements like SET, MERGE, MODIFY or UPDATE. You can see below image to understand more.

Question-35: Why do you need Data step followed by another Data step sometime?

Answer: We need to sometime format the complex data before doing any analysis using the procedure. In this case we can divided Data step in multiple data step or before analyzing the data we wanted to further process the data.