Pages

Saturday, June 14, 2014

REXX - HELLO WORLD

Let try out our first REXX module and enjoy.

/* REXX */
SAY 'HELLO WORLD'

Put this in a PDS member (ideally, create one like Letmetry.REXX.EXEC).

Now, there are various ways by which you can invoke a REXX program.


1. From ISPF main panel, run the command

TSO EX 'Letmetry.REXX.EXEC(HELLO)' EX


2. From READY Prompt, run the command,

EX 'Letmetry.REXX.EXEC(HELLO)' EX



3. Using 3.4, browse to the PDS Letmetry.REXX.EXEC.
Before the member HELLO, enter EX and press enter.



4. You can also run the REXX program through a JCL. The following is the JCL step that you need.


//REXXBTCH EXEC PGM=IKJEFT01
//SYSEXEC DD DSN=MYHQL.REXX.EXEC,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
%HELLO
/*

The above are the manual ways. Below are the advanced methods which needs special privileges

IF you have added the PDS to SYSEXEC then we can execute even by below commands. This needs admin access, Just execute this once and using the below methods you can easily execute them

/* rexx */
/* Rexx lib */
DSNAME = 'BNKSPS.TSO.CMD'
DDNAME = 'SYSPROC'
 /* To get all DSNs already associated to SYSPROC    */
ADDRESS ISPEXEC "QBASELIB" DDNAME "ID(DSLIST)"
 /* ADDRESS ISPEXEC "GETPROF DSLIST" */
say DSLIST;
 /* to allocate DSNs already allocated to SYSPROC plus my DSN */
"ALLOC F("DDNAME") DA("DSLIST",'"DSNAME"') SHR REUSE"
RETURN


1. You just need to execute command from ISPF,

TSO HELLO


2. From READY prompt, just enter


HELLO

No comments:

Post a Comment