Submit REXX Questions to Computer Education Techniques CETi

Submit REXX Questions to Computer Education Techniques - CETi

Submit REXX Questions

Home

Submit REXX Questions

REXX Technology Update

Knowledge Base


Submit REXX Questions to Computer Education Techniques CETi Advanced search
     

Interrelated Information Technology

Mainframe Questions Programming Language Questions

The Computer Education Techniques knowledge base is a service for answering questions, inclusive of the research and validation of the accuracy of information in the public domain. Citation of source documentation and examples are used to provide answers to the questions. Utilization of the information of this service and reliance on the answers, information or other materials received through this web site is done at your own risk.

Q

We could use some help with this REXX exec code.  There is a condition which prevents a job from starting when it is Monday -Friday, 6AM - 6PM.   Is there a better way for coding the condition? Can an if date(“w”) >= “Monday” & date(“w”) <= “Friday” be used in the weekday check?

 IF (((DATE("W") = "Monday"),                  

    | DATE("W") = "Tuesday"),                 

    | DATE("W") = "Wednesday"),               

    | DATE("W") = "Thursday"),                 

    | DATE("W") = "Friday")))    THEN DO      

 if ((TIME("N") >= "06:00"),                  

   & (TIME("N") <= "18:00"))       then return

   END

Address Oper

“*X DR,M=WasServer”
A

The code looks fine; however, there is another method which may be worthwhile to evaluate. A search can be performed for a string of days and if not found, it is a weekday.

The REXX POS function can be used.

   Example:

 IF POS(DATE("W"),"SATURDAYSUNDAY") = 0  THEN DO       /* THIS WILL CHECK FOR A WEEKDAY  */


Q I am converting from CLIST to REXX code.  Do you have any recommendation regarding this code?

This REXX code was submitted for review by Team SYS-ED.

/*REXX____________________________________________________________*/
/*******************************************************************
/* NAME OF THIS DATASET -- 'CPY.ET995.DEECLIB(VAPREP)' *
/* IS A COMMAND CLIST FOR EARNINGS MODERNIZED/PRE-POSTING *
/* IS CALLED BY 'CPY.ET995.DEEPLIB(VSEARN13)' *
/* MAINTAINER --- PHONE --- *
/******************************************************************/
/* COMMAND DISPLAY JCL */
/* REXX PANELS SKELETON MECPYGES */
/* -------- -------- -------- -------- */
/* VAPREP VAPREP VAPREP VALID000 */
/* V2STEPLB VALID001 */
/* V2VALIDZ VALID002 */
/* VALID003 */
/* */
/*________________________________________________________________*/

ADDRESS TSO
DO
TRACE R
CALL MS('OFF')
END

REGVAR
ADDRESS ISPEXEC "VGET (VAL CV TY TAXY DAILYOUT PRIOROUT PRIORDTE ",
CFMRDATE CFMNAME CMONTH CDAY CCENTURY ",
CYEAR SHARED "

INIT
REENTER = 'N'
NUMSTEPS = 1
ADDRESS ISPEXEC "VPUT REENTER NUMSTEPS" SHARED
PRF = SYSVAR(SYSPREF)
PRFNUM = SUBSTR(PRF,2,5)
MSG = 1
CLASS = 'T'
OUTQUAL = DAILYOUT
MM = CMONTH
DD = CDAY
CCYY = CENTURY||YEAR
VERS = 'V'
TOTAL = 1

VABED1 = 'CPY.ET996..EBVABED'
VABED2 = 'CPY.ET996..EBVABED'
VABED3 = 'CPY.ET996..EBVABED'
AMUEI = 'CPY.ET996..AMUEI'
SRPOUT = 'CPY.ET996..SRPOUT'
RUN = ''

PGM1 = 'VAPREP'
LOOPCTR = NUMSTEPS + 1
DO = YPRGM + CTR
ADDRESS ISPEXEC VPUT YPRGM SHARED
CTR = CTR + 1
IF CTR > LOOPCTR THEN RETURN
END

START
N = 0
ADDRESS ISPEXEC VPUT DISPLAY REFRESH
ADDRESS ISPEXEC VPUT DISPLAY PGM
DO
ADDRESS ISPEXEC MSG
SIGNAL FINI
END
IF VMCC = 8 THEN DO SIGNAL

A The DO loop is pretty sophisticated in REXX.

For example:

DO B = 1 FOR 4
SAY " B= " B
END

In your code, counters and checks are not needed.

You also might want to consider an alternative to the SIGNAL command.  In the snippet of code, you used the SIGNAL command a number of times as an alternative to a GOTO. It will make the code harder to read.

/*REXX____________________________________________________________*/

/* Code snippet */.
.
.
LOOPCTR = NUMSTEPS + 1
DO = YPRGM + CTR
ADDRESS ISPEXEC VPUT YPRGM SHARED
CTR = CTR + 1
IF CTR > LOOPCTR THEN RETURN
END


Q We are in the process converting CLISTs to REXX. Is there anyway to shorten the way to share a variable in the address using VGET? I have enclosed some sample code.

/*REXX___________________________
COMMAND DISPLAY JCL
CLISTS PANELS SKELETON MESSAGES
-------- -------- -------- --------
VAPREP VAPREP VAPREP VALID000
V2STEPLB VALID001
V2VALIDZ VALID002
VALID003

/*_______________________________
MAIN CONTROL

_________________________________*/
ARG PRSR
CALL 1000_INIT /* INIT OR SET VARIABLES */
CALL 2000_LOGIC /* SET LOGIC */
END

EXIT_VAPREP
CALL 4000_FINAL /*CLEANUP AND EXIT */
EXIT

1000_INIT

ADDRESS ISPEXEC "VGET (VAL CV TY TAXY DAILYOUT PRIOROUT PRIORDTE ",
CFMRDATE CFMNAME CMONTH CDAY CCENTURY ",
CYEAR" SHARED
PRF = SYSVAR(SYSPREF)
PRFNUM = SUBSTR(PRF,2,5)
MSG = 1
CLASS = 'T'
OUTQUAL = DAILYOUT
MM = CMONTH
DD = CDAY
CCYY = CENTURY||YEAR
VERS = 'V'
RETURN

000_LOGIC

A The technique that you are using for the VGET is the proper way of getting a variable from the SHARED pool. You may be able to use the ADDRESS ISPEXEC standalone command and then issue the VGET without the ISPEXEC prefix. This is useful when running many ISPEXEC statements. VGET is taught and demonstrated in our Dialog Manager course.

Q What does REXX stand for and is it still used?
A REXX stands for the REstructured eXtended eXecutor language. It was intended to be used for text processing tasks. REXX was part of IBM’s SAA standard and was included as a standard component in its operating systems – mainframes, midrange, and PC. Most of the REXX programming currently is for maintenance and retrofitting of the existing code. There have been some enhancements to REXX for utilization with client/server and web access applications.

Q Does SYS-ED still offer REXX courses?
A SYS-ED still offers both standalone REXX courses and an integrated REXX curriculum through our New York schedule and on a private basis at the client’s site. Our library and workshops consist of 1000’s extensive cross platform (It was called the SAA standard in the 1980’s) sample programs and workshops. Our staff of systems consultant trainers have coded, debugged and taught REXX in multiple environments - OS/390, z/OS, z/VM, OS/2 and Windows - from the introduction of REXX through today.

Q Does SYS-ED offer a REXX training program?
A Yes, we offer tailored REXX training programs; but only on a private basis. The program consists of an integrated series of courses - REXX Programming, REXX Programming - Advanced, Clist Programming, and Dialog Manager. Optional courses which can be included are JCL Utilities: Dialog Manager Advanced. Quite frankly, there is not a great demand for REXX training programs. In most cases, these courses are conducted for government municipalities and Fortune 1000 companies which will be called upon to do maintenance and retrofitting of code.

Q I have been told that REXX is an interpretive language; is there a more powerful compilation version of REXX?
A The answer is yes to both questions. Yes, REXX is an interpretive language and yes there is a true programming language. We have the resources to offer our client organizations a choice of the REXX platform to be trained on.

Q I have been assigned to do REXX maintenance coding. It quickly has become apparent that I need to learn more than simply REXX in order to successfully perform my job. What other IBM systems software would it be helpful to be proficient with?
A The following IBM systems software typically been utilized in conjunction with REXX:
  • Xedit commands
  • Clists
  • Dialog Manager

Schedule