Database extract function (Batch stream)


When you want to produce a File-AID for IMS extract, it is recommended that you use the JCL that is automatically generated when you execute the online conversation invoked through Option 4.1, Database Extract. If customized JCL is required, the best approach is to begin by using Option 4.1 to generate JCL that is as close to what is required as possible. Save a copy of this JCL by following the instructions found in Editing the Generated JCL. You can then make changes to the generated JCL.

The following section describes required parameter information and DD statements required to execute a File-AID for IMS extract.

The batch job consists of the following steps:

  1. SRTGEN1 - Allocate and initialize temporary dataset to-dataset-name.CK.
  2. SRTGEN2 - Allocate and initialize temporary dataset to-dataset-name.XK.
  3. SRTGEN3 - Allocate and initialize temporary dataset to-dataset-name.RK.
  4. SRTKEY - (Optional) sort key file used to drive extract.
  5. DBEXTRCT - Data Base Extract (XIXDTFDV)

    Retrieves segments from the extract FROM database, applies selection criteria (if specified), applies application relationships (if specified), and writes the segment data, along with File-AID for IMS/ISPF prefix information, to the extract TO file.

  6. DELETE - Deletes temporary data sets allocated in steps 1-3.
  7. RPTSTATS - Data Base Extract Summary Reporting (XIXRPTDV)

    Writes a report that summarizes the results of the extract.

  8. EXFMT - Reformat Extract file for Disguise.
  9. XFRMAIN - Disguise the Extract file.

The data sets allocated and initialized in the first three steps of the extract job are used by XIXDTFDV as it processes logically related databases and application relationships. Database keys required to resolve these relationships are written to the file associated with the SORTIN02 DD statement. Database keys that have already been extracted are written to the SORTIN01 DD statement. XIXDTFDV calls DFSORT to determine which of the keys written to the SORTIN02 DD statement have not been processed. The result is written to the data set associated with the SORTOUT DD statement. XIXDTFDV continues processing unresolved logical and application relationships until either the data set associated with the SORTOUT DD statement is empty, or the chase limit set by the Number of Chase Cycles to Process parameter has been reached.

DFSORT is called using the parameters shown in the following figure. The VLSHRT option is required to allow DFSORT to process records in a variable blocked data set that are shorter than the sort field. The DYNALLOC option will dynamically allocate an optimal number of SORTWRK data sets. root.key.lgth is the length of the root key of the driving database for the extract (the DBD specified as the “FROM” data base. You may chose to remove this option, however, an appropriate number of SORTWRK data sets must be allocated in the DBEXTRCT job step. All remaining sort parameters should not be modified, otherwise the DBEXTRCT step will not function properly.

DFSORT Parameters

OPTION VLSHRT,DYNALLOC               
MODS E35=(XIXICE35,512,,N)           
MSGDDN=SORTMSG                       
OUTFIL FILES=OUT                     
RECORD TYPE=V,LENGTH=(3840,3840,3840)
SORT  FIELDS=(6,root.key.lgth+2,CH,A,5,1,CH,A)

Note that the LRECL parameters referenced in the JCL are computed by XIXDTFDV. The calculation is equal to the length of the longest concatenated key of all segments written to the extract dataset plus 11 bytes.

If a file containing database keys is to be used to drive a database extract, it should be sorted in ascending key sequence. JCL generated to by File-AID for IMSto execute an extract will include the step labeled SRTKEYS if a key input file is to be used. This step is not necessary if the file containing the keys is already in sort sequence. If this is the case, delete the SRTKEYS step from the generated JCL. If an unsorted key file is used to drive the extract, the file should contain no duplicates. If duplicate keys are present and the file is not in sort sequence, duplicate records will be extracted. This will cause errors when loading the extracted data into a database.

The parameter information in the PARM field on the EXEC statement for the DBEXTRCT step must have the following format:

EXEC Statement PARM Field - DBEXTRCT Step

Description

Value

Start Posn

End
Posn

Constant

/N

1

2

Primary DBD name

name of primary DBD

3

10

Selection Criteria Usage

E or N

11

11

Constant

DTF

12

14

Extract Job Type

DLI or BMP

15

19

Application Group Name

enter if required (BMP only)

20

27

CICS/IMS System

enter if BMP job type

28

31

Use Application Relationships

Y or N

32

32

UNUSED


33

37

PSB/ACB Name

For static PSB only

38

45

PCB Number

PCB number within PSB (static PSB only)

46

50

Extract based on key values

Y or N

51

51

PSB Type

S for Static PSB
D for Dynamic PSB

52

52

Number of Chase Cycles to Process

0 indicates no limit, a value of 1 to 9999 sets a limit.

53

56

Disguise Indicator

1, 2, or 3

57

57

PROCSEQ name

The name of the index to use for extract processing.

58

65

Partial database record indicator

For secondary index processing only. If this value is set to “Y”, the indexed segment and its children will be extracted along with parent segments in the path from the ROOT segment to the indexed segment. This will minimize the number of extracted segments while producing an extract that can be loaded using a load procopt.

66

66

In the example below, a BMP extract job is run against the DBD PORDR in a BMP environment and an IMS System of TEST. Existing selection criteria and application relationships are applied.

//       PARM='/NPORDR   EDTFBMP          TESTY                  ND0000 
//             N' 

The following DD statements are required for the DBEXTRCT step:

DBEXTRCT DD Statements

DD Statement

Description

STEPLIB

Designates the IMS system data sets that contains the IMS nucleus, required action modules, and the library where the File-AID for IMS/ISPF load modules are stored.

DFSRESLB

Designates the IMS system data sets that contain the IMS nucleus and required action modules.

RECON1
RECON3
RECON3

IMS RECON data sets for DLI processing — only added to JCL if specified on Option 0.4 screen.

DFSHALDB
SYSHALDB

If HALDB Selective partition processing was chosen, these DDs will contain the control cards and a report.

PROCLIB

DFSESL

When you specify the SSM IMS parameter on either a DL/I or BMP parameter string, the system attempts to allocate appropriate data sets to the PROCLIB and DFSESL ddnames for use during edit and browse sessions. In addition, JCL that executes DL/I or BMP jobs contains the appropriate concatenations of these ddnames.

IMS

Designates the PSB load library data sets that contain the PSB member that describes the databases (static PSB only).

IXPD1

Designates the DBD load library data sets that contain the DBD members that describe the databases.

IEFRDER

Designates the IMS log data set. This DD is not required for BMP extract job types. The extract job does not do updates; therefore, a log is not required to record the updates. If using a dynamic PSB, the DD is generated as DD DUMMY. If using an existing PSB, the generated JCL provides a temporary data set. Although there are no updates, IMS requires that a data set be present for the IEFRDER DD if using DBRC and the PSB has any update capability.

DFSVSAMP

The data set that contains the control statements that describe the buffer pools used by IMS. This DD is not required for BMP extract job types.

IXPMLIB

The library that contains File-AID for IMS/ISPF messages.

SYSOUT

The output class for possible error messages.

SYSPRINT

Must be DUMMY, with the DCB coded as shown.

IXPSTATS

The temporary data set used as input to the RPTSTATS step to create the extract summary report.

IXPIMBED

Allocate this DD to DUMMY to indicate to File-AID for IMS that all database data set names are embedded in the JCL.

IXPIMSDY

Allocate this DD to DUMMY to indicate to File-AID for IMS that all database data set names are to be obtained from the IMS dynamic allocation source.

DB datasets

These DDs are not required for BMP extract job types. For DLI job types, the DD statements are either included as actual DD statements or they are included as comments. If all the database dataset names were obtained from the IMS dynamic allocation source, then a DD DUMMY statement with DD name IXPIMSDY is included to indicate this. The DD statements for the database datasets are included as comments only. When the JCL is submitted, the current data sets will be dynamically allocated by File-AID for IMS using the IMS dynamic allocation source to obtain the names. If all the data set names were not obtained from the IMS dynamic allocation source, then the IXPIMSDY DD statement is included as a comment only and the database dataset DD statements are included as true DD statements.

IXPTO

The extract TO dataset (and member, if required).

IXPTOO

This DDNAME is used in two circumstances:

  1. A secondary index is used to drive the extract and the index is not on the root segment.
  2. A key file containing a list of concatenated keys is used to drive the extract.

This DDNAME is a work data set used to eliminate potential duplicate records from the final extract dataset. It is allocated with the same attributes of the IXPTO DD.

If this DDNAME does not appear in the JCL, a temporary data set will be dynamically allocated.

IXPTON

This DDNAME is used as a work data set that will contain keys of parent segments associated with a concatenated key found in a key file. This file is used to drive the extract of the segments that lie on the path to the target segment pointed to by the concatenated key. It is also used to extract only one parent segment when the key of the parent appears more than once in the key file.

If this DDNAME does not appear in the JCL, a temporary data set will be dynamically allocated.

IXPSC

The selection criteria dataset (and member, if required).

IXPAR

The application relationship data set (and member, if required).

SYSIN

The DL/I parameters passed to DFSRRC00 as specified in Option 0.2, DLI Parameters.

or

The BMP parameters passed to DFSRRC00 as specified in Option 0.3, BMP Parameters. Only BMP parameters that can be overridden are used from here.

SORTMSG

DD statement for messages written when SORT is called by XIXDTFDV.

SORTIN

Input DD statement for used by SORT.

SORTIN01

Input DD statement for used by SORT.

SORTIN02

Input DD statement for used by SORT.

SORTOUT

Input DD statement for used by SORT.

DFSPARM

SORT parameters.

COBOUT

Data set to write COBOL Extract File Prefix layouts used in File-AID/MVS XREF. If this DD is present the COBOL prefix layouts will be written to it.

PLIOUT

Data set to write PL/I Extract File Prefix layouts used in File-AID/MVS XREF. If this DD is present, the PL/I prefix layouts will be written to it.

IXPKEYFI

This DD statement is required only if a key file is used during extract processing. Since the key file is sorted to a temporary data set in the preceding step, the original name must be passed to the extract step so that it can be reported. This is accomplished by assigning this DD name the name of the original key file.

IXPINS

This DD statement is required only if a key file containing secondary index keys is to be used to drive the extract.

The parameter information in the PARM field on the EXEC statement for the RPTSTATS step must have the following format:

EXEC Statement PARM Field - RPTSTATS Step

Description

Value

Start Posn

End
Posn

Constant

/N

1

2

Maximum Print Lines Per Page

20 to 99

3

4

Spacing Before Detailed Headers

1 to 5, or T

5

5

Data Format

E, D, or M

6

6

Terminal Type


7

14

The Maximum Print Lines Per Page and Spacing Before Detailed Headers parameters are common report parameters that are explained more fully in Print parameters.

Data format values of D and M are valid only for Double-Byte Character Set (DBCS) support.

The Terminal Type is used to determine the correct character set for the terminal and should be the same as that defined in ISPF Option 0.1 (ISPF Terminal Characteristics).

The following DD statements are required for the RPTSTATS step:

RPTSTATS DD Statements

DD Statement

Description

STEPLIB

The data set where the File-AID for IMS/ISPF load modules reside.

IXPSTATS

The temporary data set, passed from the DBEXTRCT step, that contains statistics used for reporting purposes.

IXPMLIB

The library that contains File-AID for IMS/ISPF messages.

SYSOUT

The output class for the extract summary report.

IXPD1

The DBD load library data sets that contain the DBD members that describe the databases.

EXFMT

EXFMT is the File-AID for IMS program name. EXFMT is the name of the Extract Format EXEC step.

IXRMAIN

IXRMAIN is the File-AID for IMS program name. DISG is the name of the Data Privacy EXEC step.

An extract execution return code (RC) appears in the extract output listing. For return code 16 an error code and message that indicate the specific problem also appears in the listing. In general, the return codes can be summarized as follows:

RC

Explanation

Description

0
job ran to completion
none
4
job ran to completion
none
16
job aborted; severe error
input or system error

There are two additional steps: Extract Format, and Data Privacy. The first, Extract Format, allows you to indicate whether to retain or keep the result of the extract process, when you have opted to disguise the extracted data. You can identify the Disguise control file to use, and indicate whether to create an audit file of the disguise processing.

The following DD statements are required for the Extract Format step:

Extract Format

DD Statement

Description

IXPTO

If Data Privacy was specified, this is the dataset name for the temporary file containing the encoded extract data.

STEPLIB

The data set where the File-AID for IMS/ISPF load modules reside.

IXPD1

Designates the DBD load library data sets that contain the DBD members that describe the databases.

IXPMLIB

The library that contains File-AID for IMS/ISPF messages.

SYSOUT

The output class for possible error messages.

IXPFD

The XREF dataset.

IXPCKEY

The temporary layout data set.

IXPTO

The temporary reformatted extract dataset.

IXPED

This is the dataset name for the temporary file containing the encoded extract data. This file is passed to Data Disguise step.

IXPIXHDR

File-AID for IMS Extract File header record.

The next step is Data Privacy. The following DD statements are required for the Data Disguise step:

Data Disguise

DD Statement

Description

STEPLIB

The data set where the File-AID for IMS/ISPF load modules reside.

MSGLIB

The library that contains File-AID for IMS/ISPF messages.

SYSOUT

The output class for possible error messages.

RDXMLIB

The library that contains RDX messages.

SYSPRINT

Must be DUMMY, with the DCB coded as shown.

IXPTO

The extract TO dataset (and member, if required).

FAIMSHDR

File-AID for IMS Extract File header record.

DISEXT

The disguised extract TO dataset (and member, if required).

AUDIT

Audit trail file of Disguise processing.

DISGCTL

The Disguise Control file used.

EXTRACT

The temporary reformatted extract dataset from the Format step.

The File-AID/MVS Copy step copies the XREFs that are to be converted to a temporary data set that is used in the Convert step to convert the copied XREFs to a File-AID/MVS XREF. See to the File-AID Batch Reference manual for more information about the File-AID/MVS Copy and Convert.

Extract File Contents

The TO file produced by the batch extract job is in File-AID for IMS’s unload format. The file consists of one header record, a DBD record if application relationships were applied, and data records for each segment extracted. The following figure shows an example of the contents of an extract file in hexadecimal format.

Extract File Contents - Hexadecimal Format

BROWSE -- CW.FISAMP.EXT -------------------------------------------------------
 COMMAND ===>
 ....IXP21.01.00YPREFIX LENGTH=  38 MAX ROOT KEY LENGTH=  6     
 0000CEDFF4FF4FFEDDCCCE4DCDCEC744FF4DCE4DDDE4DCE4DCDCEC744F44444
 000097721B01B0087956970355738E003804170966302580355738E00600000
 -------------------------------------------------------------------------------
 ....DBDPPART
 0000CCCDDCDE44444444444444444444444444444444444444444444444444444444444444444444
 00004247719300000000000000000000000000000000000000000000000000000000000000000000
 -------------------------------------------------------------------------------
 ........PORDR ..ORDR010 ..AA4444   AA4444HIGH PERFORMANCE COAX
 00000000DDDCD44400DDCDFFF400CCFFFF44444444CCFFFFCCCC4DCDCDDDCDCC4CDCE44444444444
 01010001769490000169490100001144440000000011444489780759669415350361700000000000
 -------------------------------------------------------------------------------
 ........PORDR ..ORDR020 ..AA444401 ..01POOPEN   C33333COAXIAL C       ABLE - GRE
 00000000DDDCD44400DDCDFFF400CCFFFFFF4444440BFFDDDDCD444CFFFFFCDCECCD4CCCDC464CDC
 01010002769490000269490200001144440100000002017667550003333333617913031235000795
 -------------------------------------------------------------------------------
 ........PORDR ..ORDR030 ..AA44440101 01QA.. ... .OKGRINDING            198802141
 00000000DDDCD44400DDCDFFF400CCFFFFFFFF4444FFDC00400040DDCDCDCCDC4444444FFFFFFFFF
 0101000376949000036949030000114444010100000181020C020C62799549570000000198802141
 -------------------------------------------------------------------------------
 ........PORDR ..ORDR030 ..AA44440104 04WA........BDFINISHING           19880902

The header record, which is the first record in the file, contains the product code and version, a one-byte load indicator, the prefix length, and the maximum root key length for the FROM database. This information is used during the Data Base Load function.

The prefix length is the length of the File-AID for IMS control information that is at the front of each data record in the file. The database segment data begins immediately after the prefix in each extract record. The maximum root key length is the length of the longest key for the root segments of all databases participating in the extract. For further information on the contents and layout of this file, see Advanced Topics.

If application relationships are applied, the second record is the DBD record. The DBD record contains the DBD names of application related databases.

Extract File Contents - Hexadecimal Format with Encryption

BROWSE   PMIPXR0.DGEXFILE.D070227.T095210.PORDR        Line 00000001 Col 001 080
 Command ===>                                                     Scroll ===> CSR
 ....IXP21.01.00YPREFIX LENGTH=  38 MAX ROOT KEY LENGTH=  6 E   
 0000CEDFF4FF4FFEDDCCCE4DCDCEC744FF4DCE4DDDE4DCE4DCDCEC744F4C444
 000097721B01B0087956970355738E003804170966302580355738E00605000
 ------------------------------------------------------------------------------
 ....DBDPPART
 0000CCCDDCDE4444
 0000424771930000
 ------------------------------------------------------------------------------
 ........PORDR   ..ORDR010 ..AA2222        .H!v`.Sx.c,*õùJoØ5.K.w<i&S.—y.D.1."T
 00000000DDDCD44400DDCDFFF400CCFFFF44444444D0C5A73DEA2865BBD97F0D3A485E1DA3C1F07E
 010100017694900001694901000011222200000000C48A598C27D3BC5D1675F2D6C9025D894F15F3
 ------------------------------------------------------------------------------
 ........PORDR   ..ORDR010 ..AA4444        .¢*t".{ö¯ñ¬Ø<¾«‡e?ö.K.w<i&,m+y[ ÷¶˝"T
 00000000DDDCD44400DDCDFFF400CCFFFF44444444D0C5A73CE88B74BB486E0D3A485694AB49687E
 010100027694900001694901000011444400000000C4EC3F901BF77C2885F182D6C90B4E8A5D20F3
 ------------------------------------------------------------------------------
 ........PORDR   ..ORDR020 ..AA444401      .Øðá˝).£Toñ.2Œg÷¶s)3.Kn.á’×”m+y[ ÷¶˝"T
 00000000DDDCD44400DDCDFFF400CCFFFFFF44444417C5852DE982F5896A5F1D92597C94AB49687E
 010100037694900002694902000011444401000000D7A90D7E36F0267D22D322559E6C4E8A5D20F3
 ------------------------------------------------------------------------------
 ........PORDR   ..ORDR030 ..AA44440101    ã.S¥‹iœ..ÿñ%·†ú¬˘dÝë.}..û.7,m...ë.}.“ˆ
 00000000DDDCD44400DDCDFFF400CCFFFFFFFF4444E3E658B0248664BB586F1D32D0F69F10F2D3C5

When Data Disguise is requested, the data that is extracted from the databases is written to an extract file. The content of this extract file is the same as described above with the following exceptions:

  1. The header record contains an "E" in position 60 indicating that the extract file is encrypted.
  2. The data portion for each extract record is encrypted. The prefix portion of each record is not encrypted.

This encrypted extract file is then passed to the Extract Format process to reformat the extracted data for the disguise process and then deleted. You may request that this file be retained during the Extract/Load dialogue request. This encrypted extract file may not be used to load or reload any databases.

Extract File Contents - Hexadecimal Format with Disguise

 BROWSE -- CW.FISAMP.EXT -------------------------------------------------------
 COMMAND ===>
 ....IXP21.01.00YPREFIX LENGTH=  38 MAX ROOT KEY LENGTH=  6 D   
 0000CEDFF4FF4FFEDDCCCE4DCDCEC744FF4DCE4DDDE4DCE4DCDCEC744F4C444
 000097721B01B0087956970355738E003804170966302580355738E00604000
 -------------------------------------------------------------------------------
 ....DBDPPART
 0000CCCDDCDE44444444444444444444444444444444444444444444444444444444444444444444
 00004247719300000000000000000000000000000000000000000000000000000000000000000000
 -------------------------------------------------------------------------------
 ........PORDR ..ORDR010 ..AA4444   AA4444D DUCKS COAX
 00000000DDDCD44400DDCDFFF400CCFFFF44444444CCFFFFCCCC4DCDCDDDCDCC4CDCE44444444444
 01010001769490000169490100001144440000000011444489780759669415350361700000000000
 -------------------------------------------------------------------------------
 ........PORDR ..ORDR020 ..AA444401 ..01POOPEN   C33333COAXIAL C       ABLE - GRE
 00000000DDDCD44400DDCDFFF400CCFFFFFF4444440BFFDDDDCD444CFFFFFCDCECCD4CCCDC464CDC
 01010002769490000269490200001144440100000002017667550003333333617913031235000795
 -------------------------------------------------------------------------------
 ........PORDR ..ORDR030 ..AA44440101 01QA.. ... .OKGRINDING            198802141
 00000000DDDCD44400DDCDFFF400CCFFFFFFFF4444FFDC00400040DDCDCDCCDC4444444FFFFFFFFF
 0101000376949000036949030000114444010100000181020C020C62799549570000000198802141
 -------------------------------------------------------------------------------
 ........PORDR ..ORDR030 ..AA44440104 04WA........BDFINISHING           19880902

The content of this disguised extract file is the same as described above for an extract file with the following exceptions:

  1. The header record contains an "D" position 60 indicating that the extract file is disguised.
  2. The data portion for each extract record is disguised. The prefix portion of each record is not disguised.

This disguised extract may be used to load or reload databases.


 

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