Customize unload output using expressions


Only the data from two root key values will be selected by this scenario, with further exclusion on SEGC.

The input areas are dynamically allocated. This control statement could also be performed to customize the output of a RELOAD, CHANGE, or EXTRACT process. In a managed ACB environment, the active or staging directory is referred to instead of the ACB library.

Related topics

JCL to customize unload output using expressions

01  //PFPUNLD  EXEC PGM=PFPMAIN
02  //STEPLIB  DD DISP=SHR,DSN=BMC.PFP.LOAD
03  //         DD DISP=SHR,DSN=IMSVS.RESLIB
04  //         DD DISP=SHR,DSN=IMSVS.DFSMDA
05  //IMSACB   DD DISP=SHR,DSN=IMSVS.ACBLIB
06  //NEWACB   DD DISP=SHR,DSN=IMSVS.ACBLIB.NEW
07  //ULD1CPY1 DD DSN=PFP.PFPSAMP.ULD1CPY1,
08  //            DISP=(,CATLG,DELETE),UNIT=SYSDA,
09  //            SPACE=(CYL,(325,9),RLSE)
10  //PFPSYSIN DD  *
11    UNLOAD  DBD=PFPSAMP,IAREA=ALL
12      INCLUDE SEGMENT=SEGA,
13         WHERE=(SEGAKEY EQ C'4563' OR SEGAKEY EQ C'4598')
14      EXCLUDE SEGMENT=SEGC,WHERE=(10:2C < C'31')
15      OUTPUT SEGMENT=SEGB,FIELDS=(3:5C,SEGBFLD2,SEGBFLD5,25:*)
16      OUTPUT SEGMENT=SEGD,WHERE=(4:1C EQ C'B' AND 10:1C EQ C'R'),
17        FIELDS=(3:8C,:2X := AREA_NUMBER,13:*)
18      OFILECTL OAREA=ALL,DDNAME=ULD1CPY1
 /*

Descriptive text for JCL to customize unload output using expressions

Line no.

Comments

01-04

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

05

The DBD from the IMSACB DD statement is used to define the input areas.

06

The DBD from the NEWACB DD statement is used to define the output unload file.

07-09

All output areas are written to one unload file, which is specified by the ULD1CPY1 DD statement.

10

PFPSYSIN DD for Fast Path/EP control statements.

11

Defines the DBD name for the unload process. All areas are unloaded.

12-13

Limit the output file by selecting only SEGA root segments with key values ‘4563’ or ‘4598’ and their dependents. Elements of this expression are:

  • SEGAKEY EQ C'4563' – field variable/comparison operator/typed literal
  • OR – Boolean operator
  • SEGAKEY EQ C'4598' – field variable/comparison operator/typed literal

14

Exclude from selection all SEGC segments that have a value less than ‘31’ starting in column 10. Elements of this expression are:

  • 10:2C – column/length/data-type (field variable)
  • < – comparison operator
  • C'31' – typed literal

15-17

OUTPUT subcommands identify the modified segments to be output. All other selected database segments are written to the output file, but are not changed.

15

With the FIELDS keyword specified, the data for SEGB will be altered when written to the output file. Copy the first 5 bytes starting at column 3, then the search fields SEGBFLD2 and SEGBFLD5, and then write the remainder of the data starting at column 25 of the input to the end of the segment (as indicated by *). Elements of this expression are:

  • 3:5C – column/length/data-type (field variable)
  • SEGBFLD2 – DBD-defined variable
  • SEGBFLD5 – DBD-defined variable
  • 25:* - column/length (field variable) using default character data-type

16

Segment SEGD will be written to the output file only when the value at column 4 is ‘B’ and the value at column 10 is ‘R’. Elements of this expression are:

  • 4:1C and 10:1C – column/length/data-type (field variables)
  • EQ – comparison operator
  • AND - Boolean operator
  • C'B' and C’R’ – typed literals

17

With the FIELDS keyword specified, the data for SEGD will be altered when written to the output file. Copy the first 8 bytes starting at column 3, assign the area number to the next two bytes, and then write the remainder of the data starting at column 13 of the input to the end of the segment (as indicated by *). Elements of this expression are:

  • 3:8C – column/length/data-type (field variable)
  • :2X – assignment variable
  • := – assignment operator
  • AREA_NUMBER – built-in variable
  • 13:* – column/length (field variable) using default character data-type)

18

All areas are written to a single unload output file using the provided DD name.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

Fast Path/EP products reference information 4.1