A collection of useful programs I've written on IBM's MVS operating system.

Macro Library

My experience with the stack architecture of 8-bit microprocessors—as well as the Concept 14 macros—inspired me to write a macro library that simulates a stack architecture for S/390. The macro library is assigned the acronym PSM, which stands for Pseudo Stack Machine or Paul Scott's Macros depending on my mood. The PSM macros used in the code exhibits are:

PENTER    — Module entry linkage with optional stack construction
PEXIT     — Module exit linkage with auto stack destruction
PCALL     — Call external entry point reentrantly
PUSHREG   — Push one or more registers onto stack
POPREG    — Pop one or more registers from stack

   

Copyright © 1988-1989, Paul A. Scott, All rights reserved.

JCL String Compare

PSU001 — Sets the step condition code to the boolean result of the string comparison specified in the PARM field. This allows conditional execution of subsequent steps based on the comparison

Example:

//STEP0001 EXEC PGM=PSU001,PARM=('&DAY,EQ,FRI')
//*

Notes:

  • Either string may be a symbolic parameter (very handy)
  • Allowed conditionals are EQ, NE, GT, GE, LT, LE
  • Both strings are treated as characters even if all numeric
  • The shorter of two otherwise equal strings is the lesser
  • The step return code is 0 if the condition is true, 1 if false

   

Copyright © 1988-1989, Paul A. Scott, All rights reserved.

JCL Instream Data

PSU002 — Writes one or more lines of text in the PARM field to SYSOUT. The first character of the PARM field is the line separator and is not included in the output.

Example:

//STEP0001 EXEC PGM=PSU002,
//            PARM=('\',                       RECORD SEPARATOR
//            ' C INDD=SYSUT1,OUTDD=SYSUT2\',  CARD #1
//            ' S M=(MEMBERA,MEMBERB) ')       CARD #2
//SYSOUT  DD  DSN=&&IEBCOPY,UNIT=VIO, ...
//*

Notes:

  • Sybolic parameters are allowed
  • The PARM field is limited to 100 characters
  • If necessary, use multiple steps with SYSOUT DD DISP=MOD,...
  • The step return code is always 0
  • Any failure results in a system ABEND code

   

Copyright © 1988-1989, Paul A. Scott, All rights reserved.

JCL Dataset Editor

PSU003 — Copy SYSUT1 to SYSUT2 while replacing one string with another. Specify one or more "old=new" strings in the PARM field, delimited by a comma. All occurences of old in SYSUT1 will be replaced with new in SYSUT2 during the copy operation.

Example:

//STEP0001 EXEC PGM=PSU003,
//            PARM=('&&PREFIX=PROD.LOAN.SL',
//            '&&UNIT=SYSDA')
//SYSIN    DD  DUMMY,DCB=(RECFM=FB,LRECL=80,BLKSIZE=80)
//SYSUT1   DD  DSN=PROD.CONTROL.JCL(LOAN001),DISP=SHR
//SYSUT2   DD  DSN=PROD.CONTROL.JCL(LOAN001),DISP=SHR
//*

Notes:

  • Symbolic parameters are allowed
  • A string containing & must be specified as &&
  • A search string begining with & obeys JCL symbolic replacement rules of concatenation
  • The PARM field is limited to 100 characters
  • SYSIN may be used to specify up to 500 replacement strings (source configurable)
  • The PARM and SYSIN strings are combined, if present
  • If SYSUT2 and SYSUT1 are identical, then records are updated in place

   

Copyright © 1988-1989, Paul A. Scott, All rights reserved.

Calendar Generator

PSU004 — Generate a calendar for the current (or specified) year.

Example:

//STEP0001 EXEC PGM=PSU004,PARM=('1989')
//SYSOUT    DD  SYSOUT=*
//*

Alternately, use a CLIST to generate a calendar in ISPF edit.

Notes:

  • Specify a 4-digit year in the PARM field
  • If the PARM is blank or invalid, the current year is substituted
  • The calendar is written to DD name SYSOUT
  • SYSOUT is forced to DCB=(RECFM=FBA,LREC=121,BLKSIZE=6171)
  • The return code is always 0

           

Copyright © 1988-1989, Paul A. Scott, All rights reserved.

Once you've had a chance to review the code above, you may want to grab the Installation Job Stream that will install all of the programs, plus an IVP and documentation. Change only the JOB statement and the parameters on the first PROC statement. The Job Stream is set up to take care of the rest.

Important: The installation requires Assembler H or later.