Sort file in ascending order by RAP and sort logical SDEPs in reverse sequence

In this scenario, the file named PFPSAMP is sorted in ascending sequence by root anchor point (RAP).

Two selected areas of PFPSAMP are specified as input. Logical SDEPs are sorted in 'last in, first out' order to provide a reverse chronological transaction register.

JCL to sort files in ascending order by RAP and sort logical SDEPs in reverse sequence

01  //PFP  EXEC  PGM=PFPMAIN,REGION=0M
02  //STEPLIB  DD  DISP=SHR,DSN=BMC.PFP.LOAD
03  //         DD  DISP=SHR,DSN=IMSVS.RESLIB
04  //IMSACB   DD  DISP=SHR,DSN=IMSVS.ACBLIB
05  //SORTIN   DD  DSN=BMC.PFP.PFPSAMP1.UNLOAD,DISP=SHR
06  //         DD  DSN=BMC.PFP.PFPSAMP2.UNLOAD,DISP=SHR
07  //SORTOUT  DD  DSN=BMC.PFP.PFPSAMP.UNLOAD.NEW,
08  //             DISP=(NEW,CATLG),UNIT=SYSDA,
09  //             SPACE=(CYL,(500,250))
10  //PFPSYSIN DD *
11    PFPSORT DBD=PFPSAMP,OAREA=(PFPSAMP1,PFPSAMP2)
12      SORT_SEQUENCE=(RAP_ASCEND,SDEPSEQ=LIFO),
13      SORT_OPTION='DYNALLOC',
    /*

Descriptive text for JCL to sort files in ascending order by RAP and sort logical SDEPs in reverse sequence

Line no.

Comments

01-03

EXEC and STEPLIB DD statements for Fast Path/EP offline execution.

04

The IMSACB DD is required for the File Sort Utility in order to correctly write the new unload file.

05-06

Specifies the concatenated input unload data sets that contain the records that are to be processed by the PFPSORT command for areas PFPSAMP1 and PFPSAMP2.

07-09

Defines the new output unload data set to contain the sorted records

10

PFPSYSIN DD for Fast Path/EP control statements.

11

Specifies that the file using the DBD named PFPSAMP is to be sorted. The OAREA keyword specifies that the output unload file is to contain data for areas PFPSAMP1 and PFPSAMP2.

12

Specifies that the file is to be sorted in ascending sequence using RAP values. The last SDEP retrieved by IMS using GN processing will be the first logical SDEP that was inserted by the unload utility (the SDEPs will be sorted in reverse chronological order).

13

The specified parameter will be passed to the Sort utility used at your installation. In this example, the sort utility will use dynamically allocated sort work data sets so they are not hardcoded in the JCL.

Was this page helpful? Yes No Submitting... Thank you

Comments