running REXX in batch 
Author Message
 running REXX in batch

Hi,

How do i run rexx scripts in batch mode on an IBM mainframe ??

thanks

-vik



Sat, 10 Feb 2001 03:00:00 GMT  
 running REXX in batch

Quote:
>How do i run rexx scripts in batch mode on an IBM mainframe ??

//**************************************************************
//PARMTEST  EXEC PGM=IKJEFT01,
//          PARM=(PARMTEST,PARM1,
//             PARM2,
//             PARM3)
//SYSEXEC   DD DSN=user_id.REXX.SOURCE,DISP=SHR
//SYSTSPRT  DD SYSOUT=*
//SYSTSIN   DD DUMMY

The above example runs a REXX exec called PARMTEST passing it parms PARM1,
PARM2, PARM3. PARMTEST is located in PDS user_id.REXX.SOURCE where "user_id"
would be your user ID. SYSEXEC can be allocated to any PDS containing the
REXX you wish to run. SYSTSPRT will contain all of the output such as that
produced from a SAY statement. SYSTSIN can be an alternate way to run the
exec:
//SYSTSIN   DD *
 PARMTEST PARM1 PARM2 PARM3

Using it in this manner allows for control cards to be used. Calling the
program from PARM=(PARMTEST....) allows for JCL symbolic substitution to be
used. Any DSN's you allocate inside the REXX can be allocated through a DD
statement, eliminating the need for an ALLOC statement.

There are a few other ways to do this, but I have used this many times with
only one problem. Sometimes at particular sites you cannot access the
SYSEXEC file. To get around this I have done the following:
//**************************************************************
//PARMTEST  EXEC PGM=IKJEFT01
//SYSEXEC   DD DSN=user_id.REXX.SOURCE,DISP=SHR
//SYSTSPRT  DD SYSOUT=*
//SYSTSIN   DD *
 ALTLIB ACTIVATE SYSTEM(EXEC)
 PARMTEST PARM1 PARM2 PARM3

This seems to take care of it. To verify what is actually allocated use the
following:
//**************************************************************
//PARMTEST  EXEC PGM=IKJEFT01
//SYSEXEC   DD DSN=user_id.REXX.SOURCE,DISP=SHR
//SYSTSPRT  DD SYSOUT=*
//SYSTSIN   DD *
 ALTLIB ACTIVATE SYSTEM(EXEC)
 LISTALC STATUS
 PARMTEST PARM1 PARM2 PARM3

If you want to have everything in one place you can do something like this:
//**********************************************************************
//ALLOCREX EXEC PGM=IEFBR14
//REXXLIB  DD DSN=&&REXXLIB,DISP=(NEW,PASS,KEEP),
//            DCB=(LRECL=80,BLKSIZE=0,RECFM=FB,DSORG=PO),
//            UNIT=SYSDA,VOL=SER=DEV001,
//            SPACE=(TRK,(10,5,5),RLSE)
//**********************************************************************
//REXXLIB1 EXEC PGM=JMLCOPY
//SYSOUT   DD SYSOUT=*
//SYSUT2   DD DSN=&&REXXLIB(PROCXREF),DISP=(OLD,PASS,KEEP)
//SYSUT1   DD *
 /*REXX*/
....
....
/*
//**************************************************************
//PROCXREF  EXEC PGM=IKJEFT01,PARM=(PROCXREF)
//SYSEXEC   DD DSN=&&REXXLIB,DISP=SHR
//SYSTSPRT  DD SYSOUT=*
//SYSTSIN   DD DUMMY

If you don't have JMLCOPY you could use IEBGENER or an IDCAMS REPRO
statment.

Hope this helps.



Sat, 10 Feb 2001 03:00:00 GMT  
 running REXX in batch

Quote:

> Hi,

> How do i run rexx scripts in batch mode on an IBM mainframe ??

> thanks

> -vik

  There are two ways to run REXX in batch. One is with the TSO-BATCH,
IKJEFT01, already described by another reply to your posting. Using
TSO-BATCH, your exec can do normal file allocations from within it, I
mean, you can use the TSO ALLOC command from within your exec, or you
can also allocate files with JCL DD cards.

Another method to run REXX in batch is with the REXX-MVS interface,
IRXJCL, which I use most of the times.
A disadvantage of this method is you can't issue TSO commands from
within the REXX program, and all file allocations will be done through
JCL DD cards. An advantage is you know you are running in batch:

You may use the PARSE SOURCE command to find out in which environment
you are.
If you run under IKJEFT01 (TSO-BATCH), PARSE SOURCE  whatever will
result in whatever variable containing something like

    TSO COMMAND execname SYSEXEC ? ? TSO TSO/E ?

Using IRXJCL,  the result will look like

    TSO COMMAND execname SYSEXEC ? execname MVS MVS ?

This way, your exec can know it is running in batch and behave
accordingly.

The basic JCL to run IRXJCL is something like:

//STEP1     EXEC PGM=IRXJCL,PARM='execname  parm1  parm2'
//SYSEXEC DD DISP=SHR,DSN=PDS.CONTAINING.THE.REXX
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
  any lines that your exec needs to 'pull' from a terminal
/*
//SYSTSPRT DD SYSOUT=*
//MYFILE DD DISP=SHR,DSN=MY.DATASET.NAME
//... (other files)

Yoy start by invoking program IRXJCL, passing to it as PARM the name of
your exec followed by the parameters to your own exec. Note that the
execname and its parms are separated by spaces.

The SYSEXEC card informs where your exec is located.
SYSTSPRT is your "terminal" output, to where you "say" things, or where
you see trace outputs.
SYSTSIN, the terminal input, is only necessary if your exec does any
"pull". You should place the text to be pulled here.
Note that SYSEXEC, SYSTSIN and SYSTSPRT may also be needed with the
TSO-BATCH method, IKJEFT01.

Still a word of caution about TSO-BATCH: Since TSO-BATCH runs, by
default, with PREFIX ON, it may be a good idea to start the TSO-BATCH
session by issuing a PROFILE NOPREFIX command. This way, you will avoid
some "file not found" messages, unless you take appropriate precautions
like surrounding all your datasetnames with ' ' when you issue ALLOC
commands from within the exec.
The job would then look as follows:

//STEP EXEC PGM=IKJEFT01
//SYSTSIN DD *
  PROFILE NOPREFIX
  myexec  parm1 parm2
/*
// (other cards)

Hope this helps.

Luis Paulo



Sun, 11 Feb 2001 03:00:00 GMT  
 running REXX in batch
thanks guys .. that helped a lot !!

-Vik



Sun, 11 Feb 2001 03:00:00 GMT  
 running REXX in batch
Here is another method.  You can read up on IRXJCL in the Rexx reference
manual.

//**********************************************************  
//* JCL TO EXECUTE A REXX ROUTINE IN BATCH                    
//**********************************************************  
//*                                                          
//JS001RX EXEC PGM=IRXJCL,                                    
//        DYNAMNBR=20,                                        
//        PARM='REXXROUTINE'    The rexx routine to execute is identified
here.                                    
//*                                                          
//* SYSTSIN IS USED TO EMULATE TERMINAL INPUT                
//SYSTSIN  DD DSN=XXXXXXXXXXXXXXXXX,DISP=SHR                  
//*                                                          
//* SYSTSPRT IS USED TO RECEIVE TERMINAL OUTPUT              
//SYSTSPRT DD SYSOUT=*                                        
//*                                                          
//* SYSEXEC POINTS TO THE LIBRARY CONTAINING THE ROUTINE(S)  
//*         TO EXECUTE                                              
//SYSEXEC  DD DSN=REXX.EXEC,                                
//         DISP=SHR                                                

Duane


Quote:

> >How do i run rexx scripts in batch mode on an IBM mainframe ??

> //**************************************************************
> //PARMTEST  EXEC PGM=IKJEFT01,
> //          PARM=(PARMTEST,PARM1,
> //             PARM2,
> //             PARM3)
> //SYSEXEC   DD DSN=user_id.REXX.SOURCE,DISP=SHR
> //SYSTSPRT  DD SYSOUT=*
> //SYSTSIN   DD DUMMY

> The above example runs a REXX exec called PARMTEST passing it parms
PARM1,
> PARM2, PARM3. PARMTEST is located in PDS user_id.REXX.SOURCE where
"user_id"
> would be your user ID. SYSEXEC can be allocated to any PDS containing the
> REXX you wish to run. SYSTSPRT will contain all of the output such as
that
> produced from a SAY statement. SYSTSIN can be an alternate way to run the
> exec:
> //SYSTSIN   DD *
>  PARMTEST PARM1 PARM2 PARM3

> Using it in this manner allows for control cards to be used. Calling the
> program from PARM=(PARMTEST....) allows for JCL symbolic substitution to
be
> used. Any DSN's you allocate inside the REXX can be allocated through a
DD
> statement, eliminating the need for an ALLOC statement.

> There are a few other ways to do this, but I have used this many times
with
> only one problem. Sometimes at particular sites you cannot access the
> SYSEXEC file. To get around this I have done the following:
> //**************************************************************
> //PARMTEST  EXEC PGM=IKJEFT01
> //SYSEXEC   DD DSN=user_id.REXX.SOURCE,DISP=SHR
> //SYSTSPRT  DD SYSOUT=*
> //SYSTSIN   DD *
>  ALTLIB ACTIVATE SYSTEM(EXEC)
>  PARMTEST PARM1 PARM2 PARM3

> This seems to take care of it. To verify what is actually allocated use
the
> following:
> //**************************************************************
> //PARMTEST  EXEC PGM=IKJEFT01
> //SYSEXEC   DD DSN=user_id.REXX.SOURCE,DISP=SHR
> //SYSTSPRT  DD SYSOUT=*
> //SYSTSIN   DD *
>  ALTLIB ACTIVATE SYSTEM(EXEC)
>  LISTALC STATUS
>  PARMTEST PARM1 PARM2 PARM3

> If you want to have everything in one place you can do something like
this:
> //**********************************************************************
> //ALLOCREX EXEC PGM=IEFBR14
> //REXXLIB  DD DSN=&&REXXLIB,DISP=(NEW,PASS,KEEP),
> //            DCB=(LRECL=80,BLKSIZE=0,RECFM=FB,DSORG=PO),
> //            UNIT=SYSDA,VOL=SER=DEV001,
> //            SPACE=(TRK,(10,5,5),RLSE)
> //**********************************************************************
> //REXXLIB1 EXEC PGM=JMLCOPY
> //SYSOUT   DD SYSOUT=*
> //SYSUT2   DD DSN=&&REXXLIB(PROCXREF),DISP=(OLD,PASS,KEEP)
> //SYSUT1   DD *
>  /*REXX*/
> ....
> ....
> /*
> //**************************************************************
> //PROCXREF  EXEC PGM=IKJEFT01,PARM=(PROCXREF)
> //SYSEXEC   DD DSN=&&REXXLIB,DISP=SHR
> //SYSTSPRT  DD SYSOUT=*
> //SYSTSIN   DD DUMMY

> If you don't have JMLCOPY you could use IEBGENER or an IDCAMS REPRO
> statment.

> Hope this helps.



Sun, 11 Feb 2001 03:00:00 GMT  
 running REXX in batch

Quote:
>PARM rules are for this routine, one is actually executing ISPF in batch
>mode. Therefore, any ISPF facilities required, will be available within
your
>REXX routine. Also, since ISPF runs on top of TSO, you should automatically
>have all of the TSO features at your disposal (like LISTALC, although I am
>not too sure about Access Method Services such as REPRO)). But, there is a
>price to pay. Be sure to provide plenty of REGION to your batch ISPF
>routines. I think ISPF is considerably larger than just TSO on MVS.

The ISPF commands such as LM utility commands are not available, this I know
for sure. You have to use ISPSTART to get to the LM commands. From what I
have been told. You can however use ISPEXEC PGM(exe) PARM(parms). Not sure
about other services. I use TSO commands mostly so IKJEFT01 seems to be the
easiest way.


Sun, 11 Feb 2001 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. REXX for Windows -- running a batch program

2. Running APL in a batch program

3. Running TSO in batch and capturing SYSTSPRT

4. Running Batch Jobs !!

5. Can CW be run in a batch or perhaps automation

6. V4: How do I run batches?

7. Running a WHOIS command in Batch

8. (Q) run batch job on scm???

9. Running a msdos batch program

10. Running a batch file as a subroutine in DVF6

11. VA Cobol and running external batch programs

12. show time for run a batch

 

 
Powered by phpBB® Forum Software