FILECOPY-- VSAM,NOn-vsam,GDG files

/* REXX  */                                                             00010001
/* TRACE ALL */                                                                
                                                                               
  ADDRESS ISPEXEC                                                       00020001
                                                                               
     secs = TIME(S)                                                            
     secs = secs + 10001                                                      
                                                                               
     call set_libraries                                                        
     call display_panel                                                        
                                                                               
/*--------------------------------------------------------------------*/      
/*            This para initially sets the libraries                  */      
/*--------------------------------------------------------------------*/      
                                                                               
/*--------------*/                                                            
  set_libraries:                                                              
/*--------------*/                                                            
                                                                               
     "ISPEXEC LIBDEF ISPPLIB DATASET ID('ST.ISP.ISPPLIB')"                    
     "ISPEXEC LIBDEF ISPMLIB DATASET ID('ST.ISP.ISPMLIB')"                    
     "ISPEXEC LIBDEF ISPSLIB DATASET ID('ST.ISP.ISPSLIB')"                    
                                                                               
     Return                                                                    
                                                                               
/*--------------------------------------------------------------------*/      
/*            This para displays the panel when invoked               */      
/*--------------------------------------------------------------------*/      
                                                                               
/*--------------*/                                                            
  display_panel:                                                              
/*--------------*/                                                            
                                                                               
  R = ' '                                                               00060001
  Q = ' '                                                               00060001
  S = ' '                                                               00060001
                                                                               
                                                                               
  "VPUT (R,ZCMD) PROFILE"                                               00070001
  "DISPLAY PANEL(OPTION) CURSOR(R)"                                     00080001
  if R = 'x' ³ R = 'X' ³ PFK = 'PF03' ³ ZCMD = '=x' ³ ZCMD = '=X' then  00090001
     DO                                                                        
       Exit                                                             00100001
     END                                                                      
  else                                                                  00110001
     if R = ' ' & ZCMD = '=x' ³ ZCMD = '=X' then                        00120001
        Exit                                                                  
     else                                                               00110001
       DO                                                                      
         call verify_input_option                                              
         call exit_code                                                        
       END                                                                    
                                                                               
  Return                                                                      
                                                                        00380001
/*--------------------------------------------------------------------*/      
/*            This para validates the input given by user             */      
/*--------------------------------------------------------------------*/      
                                                                               
/*--------------------*/                                                      
  verify_input_option:                                                        
/*--------------------*/                                                      
                                                                               
        if R = 'a' ³ R = 'A' then                                       00120001
           do                                                           00130001
             call OPT1                                                  00150001
           end                                                          00160001
        else                                                            00170001
        if R = 'b' ³ R = 'B' then                                       00180001
           do                                                           00190001
             call OPT2                                                  00210001
           end                                                          00220001
        else                                                            00230001
        if R = 'c' ³ R = 'C' then                                       00240001
           do                                                           00250001
             call OPT3                                                  00270001
           end                                                          00280001
        else                                                            00290001
          do                                                            00300001
            ZEDSMSG = 'Invalid option'                                  00310001
            "SETMSG MSG(ISRZ001)"                                       00330001
            cur = 'R'                                                   00340001
          end                                                           00350001
          call display_panel                                                  
                                                                               
/*-------------------------------------------------------------------*/        
/*  This para displays panel for option A to copy PS file            */        
/*-------------------------------------------------------------------*/        
                                                                               
/*-----*/                                                                      
  OPT1:                                                                        
/*-----*/                                                                      
                                                                               
     cur='Q'                                                                  
                                                                               
     call display_panel1                                                      
                                                                               
     return                                                                    
                                                                               
/*-------------------------------------------------------------------*/        
/*  This para displays panel for option B to copy GDG dataset        */        
/*-------------------------------------------------------------------*/        
                                                                               
/*-----*/                                                                      
  OPT2:                                                                        
/*-----*/                                                                      
                                                                               
     cur='Q'                                                                  
                                                                               
     call display_panel2                                                      
                                                                               
     return                                                                    
                                                                               
/*-------------------------------------------------------------------*/        
/*  This para displays panel for option C to copy VSAM file          */        
/*-------------------------------------------------------------------*/        
                                                                               
/*-----*/                                                                      
  OPT3:                                                                        
/*-----*/                                                                      
                                                                               
     cur='Q'                                                                  
                                                                               
     call display_panel3                                                      
                                                                               
     return                                                                    
                                                                               
/*--------------------------------------------------------------------*/      
/*            This para displays the panel when invoked               */      
/*--------------------------------------------------------------------*/      
                                                                               
/*--------------*/                                                            
  display_panel1:                                                              
/*--------------*/                                                            
                                                                               
  "VPUT (Q,S) PROFILE"                                                  00001  
  "DISPLAY PANEL(CPYPNLA) CURSOR("CUR")"                                10005  
                                                                               
  If PFK = 'PF03' then                    /* Leave when F3 pressed */   30001  
     Do                                                                        
       Q=' '                                                                  
       S=' '                                                                  
       call display_panel                                                      
     End                                                                      
  Else                                                                        
     Do                                                                        
       call verify_input1                                                      
       call prepare_job1                                                      
       call display_panel                                                      
     End                                                                      
                                                                               
/*--------------------------------------------------------------------*/      
/*            This para validates the input given by user             */      
/*--------------------------------------------------------------------*/      
                                                                               
     user = userid()                                                          
                                                                               
/*--------------*/                                                            
  verify_input1:                                                              
/*--------------*/                                                            
                                                                               
/*-----------Validate Input File------------*/                                
                                                                               
     If SUBSTR(Q,1,1)="'" then                                                
        Do                                                                    
          address ispexec                                                      
          "setmsg msg(MSGIF001)"                                              
          "VPUT (Q,S) PROFILE"                                                
          cur='Q'                                                              
          call display_panel1                                                  
        End                                                                    
                                                                               
     Qual1 = SUBSTR(Q,1,2)                                                    
                                                                               
     If Qual1='XP' ³ Qual1='XQ' ³ Qual1='XS' ³ Qual1='XT' then                
        Do                                                                    
                                                                               
        End                                                                    
     Else                                                                      
        Do                                                                    
          address ispexec                                                      
          "setmsg msg(MSGIF002)"                                              
          "VPUT (Q,S) PROFILE"                                                
          cur='Q'                                                              
          call display_panel1                                                  
        End                                                                    
                                                                               
/*-----------Validate Input File------------*/                                
                                                                               
     If SUBSTR(S,1,1)="'" then                                                
        Do                                                                    
          address ispexec                                                      
          "setmsg msg(MSGIF003)"                                              
          "VPUT (Q,S) PROFILE"                                                
          cur='S'                                                              
          call display_panel1                                                  
        End                                                                    
                                                                               
     Qual2 = SUBSTR(S,1,2)                                                    
                                                                               
     If Qual2 ='XQ' ³ Qual2 ='XS' ³ Qual2 ='XT' then                          
        Do                                                                    
                                                                               
        End                                                                    
     Else                                                                      
        Do                                                                    
          address ispexec                                                      
          "setmsg msg(MSGIF004)"                                              
          "VPUT (Q,S) PROFILE"                                                
          cur='S'                                                              
          call display_panel1                                                  
        End                                                                    
                                                                               
  Return                                                                      
                                                                               
/*--------------------------------------------------------------------*/      
/*            This para prepares the job to be submitted              */      
/*--------------------------------------------------------------------*/      
                                                                               
/*------------*/                                                              
  prepare_job1:                                                                
/*------------*/                                                              
                                                                               
  Q = strip(Q,,"'")                                                            
  S = strip(S,,"'")                                                            
  Q_Qual1 = substr(Q,1,3)                                                      
  Q_Rest  = substr(Q,4)                                                        
  secs = secs + 1                                                              
                                                                               
  If Q_Qual1 = 'xp2' ³ Q_Qual1 = 'XP2' then                                    
     Do                                                                        
       tempdsn = 'XX2' ³³ Q_Rest                                              
                                                                               
       ADDRESS TSO                                                            
       user = userid()                                                        
                                                                               
       dsfile = 'XX2.'user'.APL.J'secs                                        
       "ALLOC DA('"dsfile"') NEW SPACE(5,1) RECFM(F B) LRECL(80)"              
       "ALLOC DA('"dsfile"') FI(dsfile) SHR"                                  
       STAT = MSG("OFF")                                                      
                                                                               
       a1.1 = '//'user'CP JOB (X0HRXT000000),CLASS=P,'                        
       a1.2 = '//             MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY='user''        
       a1.3 = '/*ROUTE XEQ DEV1'                                              
       a1.4 = '//**********************************************'              
       a1.5 = '//*         FILE COPY FROM PRD2'                                
       a1.6 = '//**********************************************'              
       a1.7 = '//PSTEP010 EXEC PGM=IEBGENER'                                  
       a1.8 = '//SYSPRINT DD  SYSOUT=*'                                        
       a1.9 = '//SYSUDUMP DD  SYSOUT=*'                                        
       a1.10 = '//SYSOUT   DD  SYSOUT=*'                                      
       a1.11 = '//SYSUT1   DD  DSN=' ³³ ''tempdsn'' ³³ ','                    
       a1.12 = '//             DISP=SHR'                                      
       a1.13 = '//SYSUT2   DD  DSN=' ³³ ''S'' ³³ ','                          
       a1.14 = '//             DISP=(NEW,CATLG,DELETE),'                      
       a1.15 = '//             DCB=(*.SYSUT1),'                                
       a1.16 = '//             SPACE=(CYL,(500,500),RLSE)'                    
       a1.17 = '//SYSIN    DD  DUMMY'                                          
       a1.18 = '//*'                                                          
       a1.19 = '//PSTEP020 EXEC PGM=IEFBR14'                                  
       a1.20 = '//SYSPRINT DD  SYSOUT=*'                                      
       a1.21 = '//SYSUDUMP DD  SYSOUT=*'                                      
       a1.22 = '//SYSABEND DD  SYSOUT=*'                                      
       a1.23 = '//SYSOUT   DD  SYSOUT=*'                                      
       a1.24 = '//SYSDBOUT DD  SYSOUT=*'                                      
       a1.25 = '//SYSABOUT DD  SYSOUT=*'                                      
       a1.26 = '//ABENDAID DD  SYSOUT=*'                                      
       a1.27 = '//ABNLTERM DD  SYSOUT=*'                                      
       a1.28 = '//DD2      DD  DSN=' ³³ ''dsfile'' ³³ ','                      
       a1.29 = '//             DISP=(MOD,DELETE),'                            
       a1.30 = '//             UNIT=SYSDA,SPACE=(CYL,(1))'                    
                                                                               
       "EXECIO * DISKW DSFILE (stem a1. FINIS)"                                
       "free da('"DSFILE"')"                                                  
                                                                               
       mem_name ='OPTIONAJ'                                                    
       jlast = substr(secs,5,1)                                                
       jobname = userid()³³jlast                                              
       /*stat = MSG("OFF") */                                                  
       stat = MSG("ON")                                                        
       call submit_job                                                        
       stat = MSG("ON")                                                        
     End                                                                      
  Else                                                                        
     Do                                                                        
       user = userid()                                                        
       mem_name ='OPTIONAD'                                                    
       jlast = substr(secs,5,1)                                                
       jobname = userid()³³jlast                                              
       /*stat = MSG("OFF") */                                                  
       stat = MSG("ON")                                                        
       call submit_job                                                        
       stat = MSG("ON")                                                        
     End                                                                      
                                                                               
Return                                                                        
                                                                        00453005
/*--------------------------------------------------------------------*/      
/*            This para displays the panel when invoked               */      
/*--------------------------------------------------------------------*/      
                                                                               
/*--------------*/                                                            
  display_panel2:                                                              
/*--------------*/                                                            
                                                                               
  "VPUT (Q,S) PROFILE"                                                  00001  
  "DISPLAY PANEL(CPYPNLB) CURSOR("CUR")"                                10005  
                                                                               
  If PFK = 'PF03' then                    /* Leave when F3 pressed */   30001  
     Do                                                                        
       Q=' '                                                                  
       S=' '                                                                  
       call display_panel                                                      
     End                                                                      
  Else                                                                        
     Do                                                                        
       call verify_input2                                                      
       call prepare_job2                                                      
       call display_panel                                                      
     End                                                                      
                                                                               
/*--------------------------------------------------------------------*/      
/*            This para validates the input given by user             */      
/*--------------------------------------------------------------------*/      
                                                                               
     user = userid()                                                          
                                                                               
/*--------------*/                                                            
  verify_input2:                                                              
/*--------------*/                                                            
                                                                               
/*-----------Validate Input File------------*/                                
                                                                               
     If SUBSTR(Q,1,1)="'" then                                                
        Do                                                                    
          address ispexec                                                      
          "setmsg msg(MSGIF001)"                                              
          "VPUT (Q,S) PROFILE"                                                
          cur='Q'                                                              
          call display_panel2                                                  
        End                                                                    
                                                                               
     Qual1 = SUBSTR(Q,1,2)                                                    
                                                                               
     If Qual1='XP' ³ Qual1='XQ' ³ Qual1='XS' ³ Qual1='XT' then                
        Do                                                                    
                                                                               
        End                                                                    
     Else                                                                      
        Do                                                                    
          address ispexec                                                      
          "setmsg msg(MSGIF002)"                                              
          "VPUT (Q,S) PROFILE"                                                
          cur='Q'                                                              
          call display_panel2                                                  
        End                                                                    
                                                                               
     X = Verify('(',Q)                                                        
     If X /= 0 then                                                            
        Do                                                                    
                                                                               
        End                                                                    
     Else                                                                      
        Do                                                                    
          address ispexec                                                      
          "setmsg msg(MSGIF005)"                                              
          "VPUT (Q,S) PROFILE"                                                
          cur='Q'                                                              
          call display_panel2                                                  
        End                                                                    
                                                                               
/*-----------Validate Output File------------*/                                
                                                                               
     If SUBSTR(S,1,1)="'" then                                                
        Do                                                                    
          address ispexec                                                      
          "setmsg msg(MSGIF003)"                                              
          "VPUT (Q,S) PROFILE"                                                
          cur='S'                                                              
          call display_panel2                                                  
        End                                                                    
                                                                               
     Qual2 = SUBSTR(S,1,2)                                                    
                                                                               
     If Qual2 ='XQ' ³ Qual2 ='XS' ³ Qual2 ='XT' then                          
        Do                                                                    
                                                                               
        End                                                                    
     Else                                                                      
        Do                                                                    
          address ispexec                                                      
          "setmsg msg(MSGIF004)"                                              
          "VPUT (Q,S) PROFILE"                                                
          cur='S'                                                              
          call display_panel2                                                  
        End                                                                    
                                                                               
  Return                                                                      
                                                                               
/*--------------------------------------------------------------------*/      
/*            This para prepares the job to be submitted              */      
/*--------------------------------------------------------------------*/      
                                                                               
/*------------*/                                                              
  prepare_job2:                                                                
/*------------*/                                                              
                                                                               
  Q = strip(Q,,"'")                                                            
  S = strip(S,,"'")                                                            
  Q_Qual1 = substr(Q,1,3)                                                      
  Q1      = substr(Q,4)                                                        
  parse var Q1 Q_Rest '('                                                      
  Q_Rest = Q_Rest ³³ ' '                                                      
  parse var Q_Rest Q_Rest1 'V00 '                                              
                                                                               
  parse var S S_Base '('                                                      
                                                                               
/*RESULT = SYSDSN("'"S_Base"'")                                                
                                                                               
  IF RESULT /= OK THEN                                                        
     Do                                                                        
       address tso                                                            
       x = outtrap(n.)                                                        
       "DEF GDG (NAME('"S_Base"') LIM(10) NEMP SCR)"                          
       x = outtrap(off)                                                        
     END                                                                      
 */                                                                            
                                                                               
                                                                               
  Address TSO                                                                  
  x = outtrap(n.)                                                              
      "DEF GDG (NAME('"S_Base"') LIM(10) NEMP SCR)"                            
  x = outtrap(off)                                                            
                                                                               
  secs = secs + 1                                                              
                                                                               
  S = S_Base ³³ '(+1)'                                                        
                                                                               
  If Q_Qual1 = 'xp2' ³ Q_Qual1 = 'XP2' then                                    
     Do                                                                        
       tempgdsn = 'XX2' ³³ Q_Rest1                                            
                                                                               
       ADDRESS TSO                                                            
       user = userid()                                                        
                                                                               
       GDFILE = 'XX2.'user'.APL.J'secs                                        
       "ALLOC DA('"GDFILE"') NEW SPACE(5,1) RECFM(F B) LRECL(80)"              
       "ALLOC DA('"GDFILE"') FI(GDFILE) SHR"                                  
       STAT = MSG("OFF")                                                      
                                                                               
       b1.1 = '//'user'CP JOB (X0HRXT000000),CLASS=P,'                        
       b1.2 = '//             MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY='user''        
       b1.3 = '/*ROUTE XEQ DEV1'                                              
       b1.4 = '//**********************************************'              
       b1.5 = '//*         FILE COPY FROM PRD2'                                
       b1.6 = '//**********************************************'              
       b1.7 = '//PSTEP010 EXEC PGM=IEBGENER'                                  
       b1.8 = '//SYSPRINT DD  SYSOUT=*'                                        
       b1.9 = '//SYSUDUMP DD  SYSOUT=*'                                        
       b1.10 = '//SYSOUT   DD  SYSOUT=*'                                      
       b1.11 = '//SYSUT1   DD  DSN=' ³³ ''tempgdsn'' ³³  ','                  
       b1.12 = '//             DISP=SHR'                                      
       b1.13 = '//SYSUT2   DD  DSN=' ³³ ''S'' ³³ ','                          
       b1.14 = '//             DISP=(NEW,CATLG,DELETE),'                      
       b1.15 = '//             DCB=(*.SYSUT1),'                                
       b1.16 = '//             SPACE=(CYL,(500,500),RLSE)'                    
       b1.17 = '//SYSIN    DD  DUMMY'                                          
       b1.18 = '//*'                                                          
       b1.19 = '//PSTEP020 EXEC PGM=IEFBR14'                                  
       b1.20 = '//SYSPRINT DD  SYSOUT=*'                                      
       b1.21 = '//SYSUDUMP DD  SYSOUT=*'                                      
       b1.22 = '//SYSABEND DD  SYSOUT=*'                                      
       b1.23 = '//SYSOUT   DD  SYSOUT=*'                                      
       b1.24 = '//SYSDBOUT DD  SYSOUT=*'                                      
       b1.25 = '//SYSABOUT DD  SYSOUT=*'                                      
       b1.26 = '//ABENDAID DD  SYSOUT=*'                                      
       b1.27 = '//ABNLTERM DD  SYSOUT=*'                                      
       b1.28 = '//DD2      DD  DSN=' ³³ ''gdfile'' ³³ ','                      
       b1.29 = '//             DISP=(MOD,DELETE),'                            
       b1.30 = '//             UNIT=SYSDA,SPACE=(CYL,(1))'                    
                                                                               
       "EXECIO * DISKW GDFILE (stem b1. FINIS)"                                
       "free da('"GDFILE"')"                                                  
                                                                               
       mem_name ='OPTIONBJ'                                                    
       jlast = substr(secs,5,1)                                                
       jobname = userid()³³jlast                                              
       stat = MSG("ON")                                                        
       call submit_job                                                        
       stat = MSG("ON")                                                        
    end                                                                        
  Else                                                                        
     Do                                                                        
       user = userid()                                                        
       mem_name ='OPTIONBD'                                                    
       jlast = substr(secs,5,1)                                                
       jobname = userid()³³jlast                                              
       /*stat = MSG("OFF") */                                                  
       stat = MSG("ON")                                                        
       call submit_job                                                        
       stat = MSG("ON")                                                        
     End                                                                      
                                                                               
 Return                                                                        
                                                                        00453005
/*--------------------------------------------------------------------*/      
/*            This para displays the panel when invoked               */      
/*--------------------------------------------------------------------*/      
                                                                               
/*---------------*/                                                            
  display_panel3:                                                              
/*---------------*/                                                            
                                                                               
  "VPUT (Q,S) PROFILE"                                                  00001  
  "DISPLAY PANEL(CPYPNLC) CURSOR("CUR")"                                10005  
                                                                               
  If PFK = 'PF03' then                    /* Leave when F3 pressed */   30001  
     Do                                                                        
       Q=' '                                                                  
       S=' '                                                                  
       call display_panel                                                      
     End                                                                      
  Else                                                                        
     Do                                                                        
       call verify_input3                                                      
       call prepare_job3                                                      
       call display_panel                                                      
     End                                                                      
                                                                               
/*--------------------------------------------------------------------*/      
/*            This para validates the input given by user             */      
/*--------------------------------------------------------------------*/      
                                                                               
     user = userid()                                                          
                                                                               
/*--------------*/                                                            
  verify_input3:                                                              
/*--------------*/                                                            
                                                                               
/*-----------Validate Input File------------*/                                
                                                                               
     If SUBSTR(Q,1,1)="'" then                                                
        Do                                                                    
          address ispexec                                                      
          "setmsg msg(MSGIF001)"                                              
          "VPUT (Q,S) PROFILE"                                                
          cur='Q'                                                              
          call display_panel3                                                  
        End                                                                    
                                                                               
     Qual1 = SUBSTR(Q,1,2)                                                    
                                                                               
     If Qual1='XP' ³ Qual1='XQ' ³ Qual1='XS' ³ Qual1='XT' then                
        Do                                                                    
                                                                               
        End                                                                    
     Else                                                                      
        Do                                                                    
          address ispexec                                                      
          "setmsg msg(MSGIF002)"                                              
          "VPUT (Q,S) PROFILE"                                                
          cur='Q'                                                              
          call display_panel3                                                  
        End                                                                    
                                                                               
/*-----------Validate Input File------------*/                                
                                                                               
     If SUBSTR(S,1,1)="'" then                                                
        Do                                                                    
          address ispexec                                                      
          "setmsg msg(MSGIF003)"                                              
          "VPUT (Q,S) PROFILE"                                                
          cur='S'                                                              
          call display_panel3                                                  
        End                                                                    
                                                                               
     Qual2 = SUBSTR(S,1,2)                                                    
                                                                               
     If Qual2 ='XQ' ³ Qual2 ='XS' ³ Qual2 ='XT' then                          
        Do                                                                    
                                                                               
        End                                                                    
     Else                                                                      
        Do                                                                    
          address ispexec                                                      
          "setmsg msg(MSGIF004)"                                              
          "VPUT (Q,S) PROFILE"                                                
          cur='S'                                                              
          call display_panel3                                                  
        End                                                                    
                                                                               
  Return                                                                      
                                                                               
/*--------------------------------------------------------------------*/      
/*            This para prepares the job to be submitted              */      
/*--------------------------------------------------------------------*/      
                                                                               
/*------------*/                                                              
  prepare_job3:                                                                
/*------------*/                                                              
                                                                               
  Q = strip(Q,,"'")                                                            
  S = strip(S,,"'")                                                            
  Q_Qual1 = substr(Q,1,3)                                                      
  Q_Rest  = substr(Q,4)                                                        
  secs = secs + 1                                                              
                                                                               
  If Q_Qual1 = 'xp2' ³ Q_Qual1 = 'XP2' then                                    
     Do                                                                        
       tempvsm = 'XX2' ³³ Q_Rest                                              
                                                                               
       ADDRESS TSO                                                            
       user = userid()                                                        
                                                                               
       vsmfile = 'XX2.'user'.APL.J'secs                                        
       "ALLOC DA('"vsmfile"') NEW SPACE(5,1) RECFM(F B) LRECL(80)"            
       "ALLOC DA('"vsmfile"') FI(vsmfile) SHR"                                
       STAT = MSG("OFF")                                                      
                                                                               
       c1.1 = '//'user'VS JOB (X0HRXT000000),CLASS=P,'                        
       c1.2 = '//             MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY='user''        
       c1.3 = '/*ROUTE XEQ DEV1'                                              
       c1.4 = '//**********************************************'              
       c1.5 = '//*         FILE COPY FROM PRD2'                                
       c1.6 = '//**********************************************'              
       c1.7 = '//PSTEP010 EXEC PGM=IDCAMS'                                    
       c1.8 = '//SYSPRINT DD  SYSOUT=*'                                        
       c1.9 = '//SYSUDUMP DD  SYSOUT=*'                                        
       c1.10 = '//SYSOUT   DD  SYSOUT=*'                                      
       c1.11 = '//SYSIN DD *'                                                  
       c1.11 = ' LISTC ENT('TEMPVSM')'                                        
       c1.12 = ' IF LASTCC = 0 THEN DO'                                        
       c1.13 = ' DELETE ('S') - '                                              
       c1.14 = ' CLUSTER - '                                                  
       c1.15 = ' PURGE '                                                      
       c1.16 = ' IF MAXCC LE 8 THEN - '                                        
       c1.17 = '   SET MAXCC = 0 '                                            
       c1.18 = '   DEFINE CLUSTER (NAME('S') -'                                
       c1.19 = '     MODEL('TEMPVSM'))'                                        
       c1.20 = '   IF LASTCC=0 THEN'                                          
       c1.21 = '     REPRO INDATASET('TEMPVSM') -'                            
       c1.22 = '       OUTDATASET('S')'                                        
       c1.23 = '   VERIFY DATASET('S')'                                        
       c1.24 = ' END'                                                          
       c1.25 = ' ELSE SET MAXCC=0008'                                          
       c1.26 = '/*'                                                            
       c1.27 = '//*'                                                          
       c1.28 = '//PSTEP020 EXEC PGM=IEFBR14'                                  
       c1.29 = '//SYSPRINT DD  SYSOUT=*'                                      
       c1.30 = '//SYSUDUMP DD  SYSOUT=*'                                      
       c1.31 = '//SYSABEND DD  SYSOUT=*'                                      
       c1.32 = '//SYSOUT   DD  SYSOUT=*'                                      
       c1.33 = '//SYSDBOUT DD  SYSOUT=*'                                      
       c1.34 = '//SYSABOUT DD  SYSOUT=*'                                      
       c1.35 = '//ABENDAID DD  SYSOUT=*'                                      
       c1.36 = '//ABNLTERM DD  SYSOUT=*'                                      
       c1.37 = '//DD2      DD  DSN=' ³³ ''vsmfile'' ³³ ','                    
       c1.38 = '//             DISP=(MOD,DELETE),'                            
       c1.39 = '//             UNIT=SYSDA,SPACE=(CYL,(1))'                    
                                                                               
       "EXECIO * DISKW VSMFILE (stem c1. FINIS)"                              
       "free da('"VSMFILE"')"                                                  
                                                                               
       mem_name ='OPTIONCJ'                                                    
       jlast = substr(secs,5,1)                                                
       jobname = userid()³³jlast                                              
       stat = MSG("ON")                                                        
       call submit_job                                                        
       stat = MSG("ON")                                                        
    end                                                                        
  Else                                                                        
     Do                                                                        
       user = userid()                                                        
       mem_name ='OPTIONCD'                                                    
       jlast = substr(secs,5,1)                                                
       jobname = userid()³³jlast                                              
       /*stat = MSG("OFF") */                                                  
       stat = MSG("ON")                                                        
       call submit_job                                                        
       stat = MSG("ON")                                                        
     End                                                                      
                                                                               
  Return                                                                      
                                                                               
/*-------------------------------------------------------------------*/        
/*                   SUBMIT A JOB FOR THE USER REQUEST               */        
/*-------------------------------------------------------------------*/        
                                                                               
/*-----------*/                                                                
  submit_job:                                                           00820003
/*-----------*/                                                                
  address ispexec                                                              
  "ftopen temp"                                                         00830003
  "ftincl "mem_name                                                     00840003
  "ftclose"                                                             00850003
  "vget (ztempf) shared"                                                00860003
  address tso                                                           00870003
     "submit '"ztempf"'"                                                00880003
     IF RC\=0 THEN "ISPEXEC SETMSG MSG("ZERRMSG")"                      00881003
                                                                               
  Return                                                                00890003
                                                                               
/*-------------------------------------------------------------------*/        
/*            This para exits the rexx code                          */        
/*-------------------------------------------------------------------*/        
                                                                               
/*----------*/                                                                
  exit_code:                                                                  
/*----------*/                                                                
                                                                               
     Exit                                                                      
                 

Comments

Popular posts from this blog

Date/time constants in JCL

JCL ABeND --

IEBGENER usage examples