Step 7. Use the FM/Db2 Export function

Log on to FM/Db2, and connect to the same Db2® system specified in Step 1. Define Db2 objects to be used during verification.

For this step of the IVP a PDS or PDS/E is required, where the FM/Db2 template for the exported data will be stored. The examples given assume a name of
TSO logonid.FM.TEMPLATE
You can specify any valid data set name that your TSO logon ID has update access to. You can use ISPF option 3.2, or a batch job, to create the data set. Create this data set with these attributes:
Organization..:PO
Record format...:FB
Record length...:80
Data set name type   PDS or Library
Set the Export options as shown in Export Options (1 of 3). Enter '0.3.7' on the FM/Db2 main menu to access the Export Options panel.
Figure 1. Export Options (1 of 3)
  Process   Options   Utilities   Help
 ──────────────────────────────────────────────────────────────────────────────
 FM/Db2 (DFF2)              Export Options (1 of 3)             Global Settings
 Command ===>                                                                  

 Data Format:
    1  1. FM/Db2 (SQLDA) format        Enter "/" to select option
       2. Db2 UNLOAD format               Native unicode processing
       3. DSNTIAUL format
       4. User defined
       5. Delimited variables (CSV)

 Execution options:
    Select option
    2  1. Online                       Enter "/" to select option
       2. Batch                   -->     Batch data set creation
       3. Batch, using Db2 UNLOAD -->     Edit Db2 UNLOAD options

 More Options:
    Enter "/" to select option
       Null indicators / CSV options   (For user-defined, CSV data formats)
       Data type format                (For user-defined data format)
  F1=Help      F2=Split     F3=Exit      F7=Backward  F8=Forward   F9=Swap
 F11=NxtPage  F12=Cancel

Return to the FM/Db2 main menu by pressing PF3.

Select the FM/Db2 Export function by typing '3.7' on the FM/Db2 main menu and pressing Enter.

Type 'FMN0USR' and 'Employee-Detail' on the From Db2® object field as shown in Export Utility. Press Enterto show the FM/Db2 Export To panel.

Enter these values on the EXPORT To partitioned... panel:
  • Export data set name: EXPORT.EMPDET
  • Template data set name: FM.TEMPLATE
  • Template member name: EMPUL
  • Template usage: 4
  • Disposition: 2
Figure 2. Export Utility
  Process   Options   Utilities   Help
 ──────────────────────────────────────────────────────────────────────────────
 FM/Db2 (DFF2)                   Export Utility
 Command ===>                                                                  

 From Db2 Object:
    Location  . . . . .                      Database  . . .          (optional)
    Owner . . . . . . . FMN0USR           +  Table Space . .          (optional)
    Name  . . . . . . . Employee-Detail                                        +

    Export count  . . . ALL            Number of rows to export

 From Template:
    Data set name . . .                                               
    Member  . . . . . .         

 Processing Options:
    Template usage                     Enter "/", "A"lways to select option
    3  1. Above                           Edit options
       2. Previous                        Edit template
       3. Generate from table
       4. Generate/Replace
  F1=Help      F2=Split     F3=Exit      F4=Expand    F7=Backward  F8=Forward
  F9=Swap     F10=Left     F11=Right    F12=Cancel
Figure 3. Export...From panel
  Process   Options   Utilities   Help
 ──────────────────────────────────────────────────────────────────────────────
 EXPORT      From FMN0USR.EMPLOYEE-DETAIL                           Top of data
 Command ===>                                                                  

 To Partitioned, Sequential or VSAM Data Set:
    Data set name . . . EXPORT.EMPDET                                 
    Member  . . . . . .         
    Volume  . . . . . .       

 To Copybook or Template:
    Data set name . . . FM.TEMPLATE                                   
    Member  . . . . . . EMPUL   

 Processing Options:
    Template usage                     Disposition
    4  1. Above                        2  1. Old or Reuse
       2. Previous                        2. Mod
       3. Generate from table
       4. Generate/Replace             Enter "/", "A"lways to select option
       5. None. (CSV output)              View options
                                          Edit template mapping
  F1=Help      F2=Split     F3=Exit      F4=Expand    F7=Backward  F8=Forward
  F9=Swap     F10=Left     F11=Right    F12=Cancel

Press Enter. An allocation panel for the export data set is displayed. See Allocation panel for Export data. Type '6' for a Non VSAM data set and press Enter to move to the second allocation panel. See Allocation panel for Export data (2).

Note:
  • If you execute this IVP step on subsequent occasions you may see a "Template replace" pop-up panel. This is a warning panel displayed when a File Manager/Db2 function is about to replace a template in a member of PDS that already exists. Press Enter to continue.
  • On subsequent executions of this IVP step the allocation panel for the export data set is not shown.
Figure 4. Allocation panel for Export data
  Process   Options   Utilities   Help
 ──────────────────────────────────────────────────────────────────────────────
 Allocate PERTHAP.EXPORT.EMPDET                                  Template saved
 Command ===>                                                                  

 New Data Set Organization:
    Select option         Instructions
    6 1. KSDS             The above data set does not exist.
      2. ESDS             To define or allocate a new data set select a data
      3. RRDS             set organization and press ENTER or press PF3/EXIT
      4. VRRDS            or PF12/CANCEL to return without allocation.
      5. LDS
      6. Non VSAM
      7. IAM KSDS         For a new data set, enter a data set name
      8. IAM ESDS         below to copy existing allocation attributes.


 Existing Data Set:
    Like data set . . . . .                                               
    Volume serial . . . . .       


  F1=Help      F2=Split     F3=Exit      F4=CRetriev  F7=Backward  F8=Forward
  F9=Swap     F10=Actions  F12=Cancel
Figure 5. Allocation panel for Export data (2)
  Process   Options   Utilities   Help
 ──────────────────────────────────────────────────────────────────────────────
 Allocate PERTHAP.EXPORT.EMPDET
 Command ===>                                                                  
                                                                    More:     +
 Specify a model data set, volume, SMS class names, or leave blank for defaults:
    Like data set . .                                               
    Volume serial . .                 (Blank for system default volume)
    Device type . . .                 (Generic unit or device address)
    Data class  . . .                 (Leave blank for default)
    Storage class . .                 (Leave blank for default)
    Management class                  (Leave blank for default)

 Space Requirements:
    Space unit  . . . CYLS             BLKS, TRKS, CYLS, KB, or MB
    Primary units . . 1                quantity of above units
    Secondary units . 5                quantity of above units
    Directory blocks  0                leave blank for SMS default
    Record format . . FB               if new format: U,F,V, or D, with B,S,A,M
    Record length . . 151     
    Block size  . . .                  physical output block size
    Data set type . .                  LIBRARY, PDS, BASIC, EXTR, EXTP or LARGE
  F1=Help      F2=Split     F3=Exit      F4=CRetriev  F7=Backward  F8=Forward
  F9=Swap     F10=Actions  F12=Cancel

Review the generated JCL. It should not be necessary to change the STEPLIB DD statements if the correct Db2® libraries are specified in the FMN2SSDM macro entry for the currently connected Db2® system.

Submit the job. The expected return code is RC=0, with 48 rows exported.

You can browse the exported data set using the View option in the File Manager Base component.