SAS macro example tutorial

SAS skills with Mainframe you can find many jobs. SAS (Statistical Analysis System) is used in Mainframe for creating reports. For Mainframe professionals, learning and working on SAS is not a difficult task. The tutorial would explain how to run SAS macro using Mainframe JCL.


The online SAS course for mainframe, without wasting your time, you can learn here. Click and buy the course.

SAS is a macro level programming language. We can write programs with SAS. In the MVS environment, we can use both On-line and Batch JCL to execute SAS macros.

SAS with MVS (Batch);

Sample JCL to run SAS:

//SASSTP1  EXEC SAS6 
//INPUT1     DD   DSN=Inputfile,DISP=SHR 
//OUTPUT1    DD   DSN=Outputfile,DISP=OLD 
//SYSIN  DD   *  DATA  WORK.M;  
 INFILE INPUT1;  
 INPUT        
 FILELD1  $1-10               
 FILELD2 $11-20;  
 IF FIELD1= ‘22GCPMGGCAP’;  
 RUN; 
/*

The above is best example, where it reads input file and filters for matching record and write into output file.

After executes RUN, it writes records into o/p file. Just grab my favourite book to start your SAS learning.

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.