Edit model example: JCL that calls the DBP function

This example shows how to use edit models to generate a batch job to print a Db2 table using the DBP function.

  1. Select option 2 from the ISPF Primary Option Menu.
  2. In the Edit Entry Panel, enter the name of a new member in a data set of type JCL. Example:
       Data Set Name . . . 'EXAMPLE.JCL(newdbpx)'
  3. In the edit session, enter the MODEL primary command.
      File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help            
    ───────────────────────────────────────────────────────────────────────────────
    EDIT       EXAMPLE.JCL(NEWDBPX) - 01.00                    Columns 00001 00072 
    Command ===> model                                            Scroll ===> CSR  
    ****** ***************************** Top of Data ******************************
    ''''''                                                                         
    ''''''
    The File Manager Models panel lists the available edit models in the JCL class.
                                  File Manager Models                               
     Option ===> jd                                                                 
                                                                                    
     Enter number or service name (RF for External Rexx Functions)                  
     Enter END command to cancel MODEL command.                                     
                                                                                    
     FM/BASE                   Base Templates              Db2 functions            
     AUD  Audit Base/Db2/IMS   BTB  Batch Template Build   BSQL Batch SQL           
     CLM  Load Module compare  BTU  Batch Template Update  DBC  Batch Db2 Copy      
     DSB  Resource Browse      TPIM Template Import        DBI  Batch Db2 Import    
     DSC  Resource Copy        TPXP Template Export        DBP  Batch Db2 Print     
     DSE  Resource Edit                                    DBX  Batch Db2 Export    
     DSEB Batch Edit           Db2 Templates               D2G  Db2 Data Generation 
     DSM  Compare              D2TP DB2 Template Crt/Upd                            
     DSG  Generate                                         IMS functions            
     DSP  Print                IMS  Templates              DBI  IMS Initialization  
     DSU  Resource Update      ICU  IMS Criteria Update    IBB  IMS Batch Browse    
     DSV  Resource view        ITU  IMS Template Update    IEB  IMS Batch Edit      
     FCH  Find/Change          IVU  IMS View Update        ILB  IMS Load            
     NSRT NOSORT (no DFSORT)                               IPR  IMS Print           
     PBK  Print Copybooks      Data set functions          IXB  IMS Extract         
     SET  Set options          DSFA Data Set Alter                                  
     SETRC Set Return code     DSFC Data Set Allocate      File Manager JCL         
     VER  Version information  DSFD Data Set Delete        JB   FM/Base JCL         
     VLM  View load Module     DSFR Data Set Rename        JD   FM/Db2 JCL          
                                                           JI   FM/IMS JCL          
                                                                                    
      F1=Help    F3=Exit   F12=Cancel
  4. Enter JD.

    The edit model for the FM/Db2 JCL is copied into the edit session.

      File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help            
    ───────────────────────────────────────────────────────────────────────────────
    EDIT       EXAMPLE.JCL(NEWDBPX) - 01.00                    Columns 00001 00072 
    Command ===>                                                  Scroll ===> CSR  
    ****** ***************************** Top of Data ******************************
    =NOTE=     ----------------------------------------------------                
    =NOTE=     --                                               ---                
    =NOTE=     --  DB2 JCL                                      ---                
    =NOTE=     --                                               ---                
    =NOTE=     ----------------------------------------------------                
    000001 //FMNDB2  EXEC PGM=FMNDB2,PARM=('SSID=sysid,SQID=sqlid')
    000002 //SYSPRINT DD SYSOUT=*
    000003 //FMNTSPRT DD SYSOUT=*
    000004 //SYSOUT   DD SYSOUT=*
    000005 //SYSTERM  DD SYSOUT=*
    000006 //SYSTSPRT DD SYSOUT=*                                 
    =NOTE=     
    000007 //FMNODPP DD DISP=SHR,DSN=OPTIM.ODPP.SAMPLIB(ENVVARS)   
    =NOTE=                                      
    =NOTE=    FMNODPP DD                               
    =NOTE=    To enable File Manager to specify and run ODPP commands,                               
    =NOTE=    you must first allocate or define a DD name FMNODPP.                               
    =NOTE=     
    =NOTE=    This name points to a data set that contains the                                
    =NOTE=    environment variables that are required by the ODPP                             
    =NOTE=    to run as a TSO or batch application.  
    =NOTE=
    =NOTE=
    =NOTE=
    =NOTE=    Where the data set member ENVVARS contains the following lines:
    =NOTE=
    =NOTE=    LIBPATH=/usr/local/odpp/odppbin                                     
    =NOTE=    ODPPLL=/usr/local/odpp/licensefiles                                 
    =NOTE=    ODPPERRL=/usr//local/odpp/odppbin                                   
    =NOTE=    ODPPTRCL=/usr/local/odpp/tracefiles                                 
    =NOTE=    ODPPTRC=N                                                           
    =NOTE=                                                                        
    000008 //SYSIN DD *                                                           
    =NOTE=                                                                        
    =NOTE=    DBP (Db2 Print)                                                     
    =NOTE=                                                                        
    =NOTE=    Purpose                                                             
    =NOTE=      To print the contents of a Db2. object in a variety of formats.   
    =NOTE=                                                                        
    =NOTE=                                                                        
    =NOTE=    Usage                                                               
    =NOTE=      The Print utility function can:                                   
    =NOTE=        - Print data in table or single formats, in either character or 
    =NOTE=          HEX.                                                          
    =NOTE=        - Select the rows and columns to be printed.                    
    =NOTE=        - Limit the number of rows to be printed.                       
    =NOTE=
    ⋮

    Notes are identified by the characters =NOTE= in the line command field. The notes contain information to help in modifying the JCL statements and parameters.

  5. Issue the RESET command to permanently remove the note lines, leaving only the data lines.
  6. Overtype line 000008 with the A line command and then enter the MODEL primary command.
      File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help            
    ───────────────────────────────────────────────────────────────────────────────
    EDIT       EXAMPLE.JCL(NEWDBPX) - 01.00                    Columns 00001 00072 
    Command ===> model                                            Scroll ===> CSR  
    ****** ***************************** Top of Data ******************************
    000001 //FMNDB2   EXEC PGM=FMNDB2,PARM=('SSID=sysid,SQID=sqlid')                                             
    000002 //SYSPRINT DD SYSOUT=*                                 
    000003 //FMNTSPRT  DD SYSOUT=*                                                  
    000004 //SYSOUT   DD SYSOUT=*                                                  
    000005 //SYSTERM  DD SYSOUT=*                                                         
    000006 //SYSTSPRT DD SYSOUT=*                                                  
    000007 //FMNODPP DD DISP=SHR,DSN=OPTIM.ODPP.SAMPLIB(ENVVARS)                                                       
    A      //SYSIN DD *                                                  
    000009 /*                                                  
    ****** **************************** Bottom of Data ****************************
  7. Enter DBP.

    The edit model for the FM/Db2 Print function is copied into the edit session.

      File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help            
    ───────────────────────────────────────────────────────────────────────────────
    EDIT       EXAMPLE.JCL(NEWDBPX) - 01.00                    Columns 00001 00072 
    Command ===>                                                  Scroll ===> CSR  
    ****** ***************************** Top of Data ******************************
    000001 //FMNDB2   EXEC PGM=FMNDB2,PARM=('SSID=sysid,SQID=sqlid')                                             
    000002 //SYSPRINT DD SYSOUT=*                                 
    000003 //FMNTSPRT  DD SYSOUT=*                                                  
    000004 //SYSOUT   DD SYSOUT=*                                                  
    000005 //SYSTERM  DD SYSOUT=*                                                         
    000006 //SYSTSPRT DD SYSOUT=*                                                  
    000007 //FMNODPP DD DISP=SHR,DSN=OPTIM.ODPP.SAMPLIB(ENVVARS)                                                       
    000008 //SYSIN DD *                                                  
    =NOTE= 
    =NOTE=    DBP (Db2 Print)                                                     
    =NOTE=                                                                        
    =NOTE=    Purpose                                                             
    =NOTE=      To print the contents of a Db2. object in a variety of formats.   
    =NOTE=                                                                        
    =NOTE=                                                                        
    =NOTE=    Usage                                                               
    =NOTE=      The Print utility function can:                                   
    =NOTE=        - Print data in table or single formats, in either character or                                                  
    ⋮
  8. Once again, issue the RESET command to remove the note lines.
      File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help            
    ───────────────────────────────────────────────────────────────────────────────
    EDIT       EXAMPLE.JCL(NEWDBPX) - 01.00                    Columns 00001 00072 
    Command ===>                                                  Scroll ===> CSR  
    ****** ***************************** Top of Data ******************************
    000001 //FMNDB2   EXEC PGM=FMNDB2,PARM=('SSID=sysid,SQID=sqlid')                                             
    000002 //SYSPRINT DD SYSOUT=*                                 
    000003 //FMNTSPRT  DD SYSOUT=*                                                  
    000004 //SYSOUT   DD SYSOUT=*                                                  
    000005 //SYSTERM  DD SYSOUT=*                                                         
    000006 //SYSTSPRT DD SYSOUT=*                                                  
    000007 //FMNODPP DD DISP=SHR,DSN=OPTIM.ODPP.SAMPLIB(ENVVARS)                                                       
    000008 //SYSIN DD *
    000009 $$FILEM DBP,                                                  
    000010 $$FILEM FORMAT=TABLE|SINGLE,                                  
    000011 $$FILEM OBJIN=location.owner.name,                            
    000012 $$FILEM OBJILOCN=location,                                    
    000013 $$FILEM OBJIOWNR=owner,                                       
    000014 $$FILEM OBJINAME=name,                                        
    000015 $$FILEM TINPUT=ddname,                                        
    000016 $$FILEM TINMEM=member,                                        
    000017 $$FILEM TMIN=template_data_set_name(member),                  
    000018 $$FILEM UCREAD=YES|NO,
    ⋮

You now have a JCL member that can be used to print a Db2 table using the FM/Db2 DBP function.