JCL to allocate new PDS using IEFBR14

//***************************************************************

//* JCL JOB EXECUTING THE IEFBR14 UTILTITY TO ALLOCATE PDS DATA S

//***************************************************************

//STEP10   EXEC PGM=IEFBR14                                      

//SYSPRINT DD SYSOUT=*                                           

//SYSOUT   DD SYSOUT=*                                           

//SYSDUMP  DD SYSOUT=*                                           

//DD1      DD DSN=IND220.INDUS.COBPGMS,                          

//            DISP=(NEW,CATLG,DELETE),                           

//            SPACE=(TRK,(10,10,10),RLSE),                       

//            UNIT=SYSDA,                                        

//            DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=800)

Advertisements

UNLOAD a table but with a delimiter ‘|’ in between the fields

UNLOAD a table but with a delimiter ‘|’ in between the fields



//JS020    EXEC PGM=IKJEFT01,                     
//             DYNAMNBR=20                        
//*                                               
//SYSTSPRT DD  SYSOUT=*                           
//SYSPRINT DD  SYSOUT=*                           
//SYSUDUMP DD  SYSOUT=*                           
//SYSPUNCH DD  SYSOUT=*                           
//*                                               
//SYSTSIN  DD  *                                  
  DSN SYSTEM(XXXX)                                
  RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARM('SQL')
//*                                               
//SYSREC00 DD  DSN=TABLEA.UNLOAD.FILE,            
//             DISP=(NEW,CATLG,DELETE),           
//             UNIT=SYSDA,LRECL=80                
//SYSIN    DD  *                                  
  SELECT  COLUMN1                                 
         ,'|',COLUMN2                                 
         ,'|',COLUMN3                                 
         ,'|',COLUMN4                                 
         ,'|',COLUMN5                                 
  FROM   TABLEA                                   
  WITH UR;                                        
/*                                                
//* 

SORT JCL to SUM up values

 

If you wish to sum up the values at a particular position sorted at some value then you can use the following sort card

 

 

The following card will sum values (lets assume salaries) appearing at pos 7th (4 bytes) grouped/sorted on data (emp numbers)

 

 

 

//SETP001  EXEC PGM=SORT                                         

//SYSPRINT DD SYSOUT=*                                           

//SYSOUT   DD SYSOUT=*                                           

//SYSUDUMP DD SYSOUT=*                                           

//REPORT1  DD SYSOUT=*                                           

//SORTIN   DD DISP=SHR,DSN=USERID.ABC.INPFILE,

//SORTOUT  DD DSN=USERID.ABC.OUTFILE,

//      DISP=(,CATLG),                                           

//      SPACE=(TRK,(30,10),RLSE),                                

//      UNIT=SYSDA,                                              

//      DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS)               

//SORTWK01 DD  UNIT=DISK,SPACE=(CYL,(20,5),RLSE)                 

//SORTWK02 DD  UNIT=DISK,SPACE=(CYL,(20,5),RLSE)     

//SORTWK03 DD  UNIT=DISK,SPACE=(CYL,(20,5),RLSE)     

//SYSIN    DD *                                      

SORT FIELDS=(37,10,CH,A),STOPAFT=10

SUM FIELDS=(7,4,ZD)                

/*                                                   

//*  

Defining record and space attributes for data class

 

Recfm

 

 

Specifies the data set record format. You can specify one of the following, with the option of appending either an A (ISO/ANSI control character) or an M (Machine control character):

U

Undefined

V

Variable

VS

Variable spanned

VB

Variable blocked

VBS

Variable blocked spanned

F

Fixed

FS

Fixed standard

FB

Fixed blocked

FBS

Fixed blocked standard

If you specify Recfm, you cannot specify the Recorg attribute.

 

Lrecl

Specifies the logical record length in bytes. If you leave the Recorg field blank, you can specify a LRECL value from 1-32760 (or leave it blank). If you choose a Recorg value of KS, ES, or RR, you can specify a LRECL value from 1-32761 (or leave it blank). If the Recorg value is KS, the LRECL value must be greater than or equal to the value you specify for the Keylen attribute. Also if the Recorg value is KS and you specify values for both the Keylen and Keyoff attributes, then the LRECL value must be greater than or equal to the sum of the Keylen and Keyoff attributes.If the Recorg value is LS, the LRECL attribute is ignored and the CIsize value is 4096.

Override Space

Specifies whether DATA CLASS attributes override attributes obtained from other sources (JCL, AMS control cards or LIKE=). Override Space flag has two values:

YES

data class override takes effect.

NO

no data class override. NO is the default.

You can override the following JCL Space subparameters, including dynamic allocations, such as TSO ALLOCATE:

  • Space type (CYL,TRK, Block length, or record length plus AVREC)
  • Primary Quantity
  • Secondary Quantity
  • Directory blocks

You can override the following IDCAMS DEFINE space parameters:

  • Cylinders (Primary, Secondary)
  • Tracks (Primary, secondary)
  • Kilobytes (Primary, Secondary)
  • Megabytes (Primary, Secondary)
  • Records (Primary, Secondary)
  • Controlintervalsize (CISIZE DATA)
  • Freespace (CI-percent, CA-percent)

 

Notes:

  1. You must explicitly specify AVGREC, AVG VALUE, PRIMARY, SECONDARY, and DIRECTORY. ISMF primes these fields with blanks, and returns an error message for each blank field. 0 is a valid value.
  2. If you set RECORG to KS, ES, RR, or LS, then you must also explicitly specify CISIZE DATA. If you set RECORG to KS, then you must also explicitly specify %FREESPACE CI and %FREESPACE CA. ISMF primes these fields with blanks, and returns an error message for each blank field. 0 is a valid value.
  3. SMS gets PRIMARY SPACE, SECONDARY SPACE, allocation units, and directory blocks either from JCL or from the DATA CLASS. The SPACE information in the DATA CLASS must be all inclusive, otherwise jobs might fail or produce unexpected results.
  4. If you set Override Space to YES, the SPACE information specified in DATA CLASS overrides the SPACE information specified on JCL, even for non-SMS managed data sets. The SPACE information in the DATA CLASS must be all inclusive, otherwise jobs might fail or produce unexpected results.

Space

Specifies a request for space in records, eliminating track and cylinder space requests.

Avgrec

Specifies a scaling factor for primary and secondary record allocations. It can have the following factors:

U

Multiplies the allocation quantity by 1

K

Multiplies the allocation quantity by 1024

M

Multiplies the allocation quantity by 1048576

Avg Value

Specifies the average length of each record.

Primary

Specifies the primary allocation quantity of records as multiplied by the scaling factor (Avgrec).

Secondary

Specifies the secondary allocation quantity of records as multiplied by the scaling factor (Avgrec).

Directory

Specifies the number of directory blocks for a PDS. It is valid only when the following fields are blank:

  • Recorg
  • Keyoff
  • CIsize Data
  • % Freespace CI
  • % Freespace CA
  • Shareoptions Xregion
  • Shareoptions Xsystem

If you specify the following values:

  • Avgrec = K
  • Avg Value = 80
  • Primary = 500
  • Secondary = 100
  • Directory = 100

you request 40000 KB of primary space, 8000 KB of secondary space, and 100 directory blocks. The JCL used to accomplish the same task looks like:

//DD1  ...   SPACE=(80,(500,100,100)),AVGREC=K   ...

Retpd or Expdt

Specifies the retention period or expiration date that is associated with the data class being defined. Retention period is the number of days (0 to 9999) and expiration date is the date when you want the definition to expire. The default is ‘blank’ for Expdt and 0 for Retpd, no expiration time.

Volume Count

Specifies the maximum number of SMS-managed DASD or mountable volumes a data set can span, with the following exceptions. Valid values are 1 through 59.

For striped VSAM data set, the volume count can be overridden by calculations derived from the sustained data rate (SDR) or the dynamic volume count which ever is greater up to the maximum of 59. For non-VSAM striped data set, volume count is determined by sustained data rate(SDR), dynamic volume count has no affect and the maximum count is 59. For managed mountable volumes, this value can be overridden by the volume count specified in JCL up to a maximum of 255. Dynamic volume count has no affect to tape data sets.

Volume count is ignored for data sets to which no storage class is assigned. The default is 1.

 

Note:

In JES3 systems, volume count is also ignored for managed mountable data sets.

Add’l Volume Amount

Specifies whether primary or secondary allocation amounts are to be used when the data set is extending to a new volume. You can specify:

  • P for primary
  • S for secondary

If you leave the field blank, the system default of primary is used. This attribute is used during VSAM EOV processing, and is only applicable to any VSAM multivolume data sets allocated in the extended format.

 

 

Go to Source <Click Me>

Understanding JCL

understanding JCL 

 

To get your MVS™ system to do work for you, you must describe to the system the work you want done and the resources you will need.

You use Job Control Language (JCL) to provide this information to MVS.

  

 

 Reference :- http://publib.boulder.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.ieab500/control.htm

 

 

The above was just a Intro to this world 🙂 This is not a site that gives you an idea what JCL is ?, I think there are many many many good places that have good documentations for that  . This is a place where you (I) can refer when we are at work and want some quick utilities , like 

 

 
  • DFSORT 
  • IEFBR14
  • Archiving
  • Restoring 
  • CA7 Bactg
  • Copying from Tape to DASD , etc

 

Will Continue this post quickly : –