Edit model example: JCL that calls the DSC function

This example shows how to use edit models to generate a batch job to copy a data set using the DSC 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(newdscx)'
  3. In the edit session, enter the MODEL primary command.
      File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help            
    ───────────────────────────────────────────────────────────────────────────────
    EDIT       EXAMPLE.JCL(NEWDSCX) - 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 ManagerZ Data Tools Models                               
     Option ===> jb                                                                 
                                                                                    
     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 JB.

    The edit model for the File Manager Base JCL is copied into the edit session.

      File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help            
    ───────────────────────────────────────────────────────────────────────────────
    EDIT       EXAMPLE.JCL(NEWDSCX) - 01.00                    Columns 00001 00072 
    Command ===>                                                  Scroll ===> CSR  
    ****** ***************************** Top of Data ******************************
    =NOTE=     ----------------------------------------------------                
    =NOTE=     --                                               ---                
    =NOTE=     --  BASE JCL                                     ---                
    =NOTE=     --                                               ---                
    =NOTE=     ----------------------------------------------------                
    000001 //FILEMGR  EXEC PGM=FILEMGR
    000002 //STEPLIB  DD DSN=FMN.SFMNMOD1,DISP=SHR                                 
    =NOTE=    If using WMQ queues via batch, uncomment and update MQHLQ to suit    
    =NOTE=     your sites WMQ high level qualifier                                 
    =NOTE=            DD DSN=MQHLQ.SCSQLOAD,DISP=SHR                               
    =NOTE=            DD DSN=MQHLQ.SCSQANLE,DISP=SHR                               
    =NOTE=            DD DSN=MQHLQ.SCSQAUTH,DISP=SHR                               
    =NOTE=     If referring to CICS resources uncomment and update CICSHLQ to suit 
    =NOTE=     your sites CICS high level qualifier                                
    =NOTE=            DD DSN=CICSHLQ.SDFHEXCI,DISP=SHR                             
    =NOTE=     Uncomment and update IGY if you need the COBOL compiler in STEPLIB  
    =NOTE=            DD DSN=IGY.SIGYCOMP,DISP=SHR                                 
    =NOTE=    //FMNCOB   DD DUMMY    Include to force use of FM COBOL Compiler     
    =NOTE=    //FMNCLERR DD SYSOUT=* Include to force output of Compiler listing   
    000003 //FMNFRPT  DD SYSOUT=*                                                  
    000004 //SYSTSPRT DD SYSOUT=*
    ⋮

    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 000013 with the A line command and then enter the MODEL primary command.
      File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help            
    ───────────────────────────────────────────────────────────────────────────────
    EDIT       EXAMPLE.JCL(NEWDSCX) - 01.00                    Columns 00001 00072 
    Command ===> model                                            Scroll ===> CSR  
    ****** ***************************** Top of Data ******************************
    000001 //FILEMGR  EXEC PGM=FMNMAIN                                             
    000002 //STEPLIB  DD DSN=FMN.SFMNMOD1,DISP=SHR                                 
    000003 //FMNFRPT  DD SYSOUT=*                                                  
    000004 //SYSTSPRT DD SYSOUT=*                                                  
    000005 //SYSTSIN  DD *                                                         
    000006 //SYSPRINT DD SYSOUT=*                                                  
    000007 //SYSOUT   DD SYSOUT=*                                                  
    000008 //FMNTSPRT DD SYSOUT=*                                                  
    000009 //SYSTERM  DD SYSOUT=*                                                  
    000010 //FMNODPP DD DISP=SHR,DSN=OPTIM.ODPP.SAMPLIB(ENVVARS)                   
    000011 //FMNAUTH  DD DISP=SHR,DSN=fmn.auth.dsn                                 
    000012 //FMNEXEC  DD DISP=SHR,DSN=fmn.exec.library                             
    a      //SYSIN    DD *                                                         
    ****** **************************** Bottom of Data ****************************
  7. Enter DSC.

    The edit model for the data set Resource Copy function is copied into the edit session.

      File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help            
    ───────────────────────────────────────────────────────────────────────────────
    EDIT       EXAMPLE.JCL(NEWDSCX) - 01.00                    Columns 00001 00072 
    Command ===>                                                  Scroll ===> CSR  
    ****** ***************************** Top of Data ******************************
    000001 //FILEMGR  EXEC PGM=FMNMAIN                                             
    000002 //STEPLIB  DD DSN=FMN.SFMNMOD1,DISP=SHR                                 
    000003 //FMNFRPT  DD SYSOUT=*                                                  
    000004 //SYSTSPRT DD SYSOUT=*                                                  
    000005 //SYSTSIN  DD *                                                         
    000006 //SYSPRINT DD SYSOUT=*                                                  
    000007 //SYSOUT   DD SYSOUT=*                                                  
    000008 //FMNTSPRT DD SYSOUT=*                                                  
    000009 //SYSTERM  DD SYSOUT=*                                                  
    000010 //FMNODPP DD DISP=SHR,DSN=OPTIM.ODPP.SAMPLIB(ENVVARS)                   
    000011 //FMNAUTH  DD DISP=SHR,DSN=fmn.auth.dsn                                 
    000012 //FMNEXEC  DD DISP=SHR,DSN=fmn.exec.library                             
    000013 //SYSIN    DD *                                                         
    =NOTE=    The following are main parameters that will be used for Data Set Copy
    000014 $$FILEM DSC ,                                                           
    =NOTE=    ********************************************************             
    =NOTE=    **                                                    **             
    =NOTE=    ** Main DSC parameters input/output resources         **             
    =NOTE=    **                                                    **             
    =NOTE=    ********************************************************             
    000015 $$FILEM DSNIN=dsname,                                                   
    =NOTE=    DSNIN=dsname                                                         
    =NOTE=     Defines the name of the From data set or an absolute path to the
    ⋮
  8. Once again, issue the RESET command to remove the note lines.
      File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help            
    ───────────────────────────────────────────────────────────────────────────────
    EDIT       EXAMPLE.JCL(NEWDSCX) - 01.00                    Columns 00001 00072 
    Command ===>                                                  Scroll ===> CSR  
    ****** ***************************** Top of Data ******************************
    000001 //FILEMGR  EXEC PGM=FMNMAIN                                             
    000002 //STEPLIB  DD DSN=FMN.SFMNMOD1,DISP=SHR                                 
    000003 //FMNFRPT  DD SYSOUT=*                                                  
    000004 //SYSTSPRT DD SYSOUT=*                                                  
    000005 //SYSTSIN  DD *                                                         
    000006 //SYSPRINT DD SYSOUT=*                                                  
    000007 //SYSOUT   DD SYSOUT=*                                                  
    000008 //FMNTSPRT DD SYSOUT=*                                                  
    000009 //SYSTERM  DD SYSOUT=*                                                  
    000010 //FMNODPP DD DISP=SHR,DSN=OPTIM.ODPP.SAMPLIB(ENVVARS)                   
    000011 //FMNAUTH  DD DISP=SHR,DSN=fmn.auth.dsn                                 
    000012 //FMNEXEC  DD DISP=SHR,DSN=fmn.exec.library
    000013 //SYSIN    DD *         
    000014 $$FILEM DSC ,           
    000015 $$FILEM DSNIN=dsname,   
    000016 $$FILEM INPUT=ddname,   
    000017 $$FILEM VOLSERIN=volser,
    000018 $$FILEM MEMBER=member1, 
    000019 $$FILEM DSNOUT=dsname,  
    ⋮

You now have a JCL member that can be used to copy a data set using the File Manager DSC function.