Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions endevor/Field-Developed-Programs/Miscellaneous-items/BUMPJOB.rex
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* REXX */
/* Bump the last character on a Jobname to next value */
/* select is either empty/next for next character */
/* or j/jump for a big gap */
Trace O
Arg jobname select
Rotation = '12345678901',
'ABCDEFGHIJKLMNOPQRSTUVWXYZA',
'@#$@'
jobname = word(jobname,1)
lastchar = Substr(jobname,Length(jobname))
locatchar = Pos(lastchar,Rotation)
If select = 'j' | select = 'jump' then,
wherenext = (locatchar + length(Rotataton) // 2
Else,
wherenext = locatchar + 1
overlaychar = Substr(Rotation,wherenext,1)
wheretohit = Min(Length(jobname)+1,8)
nextJobname = overlay(overlaychar,jobname,wheretohit)
Return nextJobname
16 changes: 16 additions & 0 deletions endevor/Field-Developed-Programs/Miscellaneous-items/GETACCTC.rex
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* REXX */
/* Find and return the Accounting code value for current user/job */

start = 540 /* it starts here */
start = D2X(start)
TCB_Addr = C2D(Storage(start,4)) /* Current TCB Addr */
JSCB_Addr = C2D(Storage(D2X(TCB_Addr+180),4))

JCT_Addr = C2D(Storage(D2X(JSCB_Addr+260),4))

ACT_Addr = C2D(Storage(D2X(JCT_Addr+56),3))
ACT_Area = Storage(D2X(ACT_Addr),110)
ACT_len = C2D(Substr(ACT_Area,49,1))
ACT_code = Substr(ACT_Area,50,ACT_len)

Return ACT_code
25 changes: 25 additions & 0 deletions endevor/Field-Developed-Programs/Miscellaneous-items/GTUNIQUE.rex
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* REXX */
/* Build a unique 8-byte name from date and time */

numbers = '123456789' ;
characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ;
ToDay = DATE(O) ;
Year = SUBSTR(ToDay,1,2) + 1;
Year = SUBSTR(characters||characters||characters||characters,Year,1)
Month = SUBSTR(ToDay,4,2) ;
Month = SUBSTR(characters,Month,1) ;
Day = SUBSTR(ToDay,7,2) ;

Day = SUBSTR(characters || numbers,Day,1) ;
NOW = TIME() ;
Hour = SUBSTR(NOW,1,2) ;
IF Hour = '00' THEN Hour = '0'
ELSE
Hour = SUBSTR(characters,Hour,1) ;
Minute = SUBSTR(NOW,4,2) ;
second = SUBSTR(NOW,7,2) ;
Unique_Name = Year || Month || Day || Hour ||,
Minute || second ;
SA= "Unique Member name is " Unique_Name

Return Unique_Name
18 changes: 18 additions & 0 deletions endevor/Field-Developed-Programs/Miscellaneous-items/QMATCH.rex
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* REXX */
PARSE ARG Parm1 Parm2

/* Check to see if Parm1 is selected (or matches) Parm2 */
/* Allowing for Parm2 to have wildcard characters */

If Parm1 = Parm2 then Return(1)

If Parm1 ='*' | Parm2 ='*' then Return(1)
whereAsterisk = Pos('*',Parm2)
If whereAsterisk = 0 then Return(0)
If whereAsterisk > 1 then whereAsterisk = whereAsterisk - 1;

If Substr(Parm1,1,whereAsterisk) = ,
Substr(Parm2,1,whereAsterisk) then Return(1)

Return(0)

46 changes: 46 additions & 0 deletions endevor/Field-Developed-Programs/Miscellaneous-items/WAITFILE.rex
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* REXX */
/* Loop in Wait status until named file appears */
/* Return 0 if file never appears after all waits */
/* Return # for number of seconds used waiting */

Arg WaitForFilename MaxLoops WaitSeconds

STRING = "ALLOC DD(WAITFILE)",
" DA('"WaitForFilename"') SHR REUSE"
seconds = WaitSeconds /* Number of Seconds to wait if needed */

Do MaxLoops
/* or at least until the file is available */
Do Loop# = 1 to MaxLoops
CALL BPXWDYN STRING;
MyResult = RESULT ;
If MyResult = 0 then Return (Loop# * WaitSeconds)
Say 'WAITFILE is waiting for' WaitForFilename
Call WaitAwhile
End /* Do MaxLoops */

Return 0

WaitAwhile:
/* */
/* A resource is unavailable. Wait awhile and try */
/* accessing the resource again. */
/* */
/* The length of the wait is designated in the parameter */
/* value which specifies a number of seconds. */
/* A parameter value of '000003' causes a wait for 3 seconds. */
/* */
/*seconds = Abs(seconds) */
/*seconds = Trunc(seconds,0) */
Say "Waiting for" seconds "seconds at " DATE(S) TIME()
/* AOPBATCH and BPXWDYN are IBM programs */
CALL BPXWDYN "ALLOC DD(STDOUT) DUMMY SHR REUSE"
CALL BPXWDYN "ALLOC DD(STDERR) DUMMY SHR REUSE"
CALL BPXWDYN "ALLOC DD(STDIN) DUMMY SHR REUSE"

/* AOPBATCH and BPXWDYN are IBM programs */
parm = "sleep "seconds
Address LINKMVS "AOPBATCH parm"

Return

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* REXX */
/* Bump the last character on a Jobname to next value */
/* select is either empty/next for next character */
/* or j/jump for a big gap */
Trace O
Arg jobname select
Rotation = '12345678901',
'ABCDEFGHIJKLMNOPQRSTUVWXYZA',
'@#$@'
jobname = word(jobname,1)
lastchar = Substr(jobname,Length(jobname))
locatchar = Pos(lastchar,Rotation)
If select = 'j' | select = 'jump' then,
wherenext = (locatchar + length(Rotataton) // 2
Else,
wherenext = locatchar + 1
overlaychar = Substr(Rotation,wherenext,1)
wheretohit = Min(Length(jobname)+1,8)
nextJobname = overlay(overlaychar,jobname,wheretohit)
Return nextJobname
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* REXX */
/* Build a unique 8-byte name from date and time */

numbers = '123456789' ;
characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ;
ToDay = DATE(O) ;
Year = SUBSTR(ToDay,1,2) + 1;
Year = SUBSTR(characters||characters||characters||characters,Year,1)
Month = SUBSTR(ToDay,4,2) ;
Month = SUBSTR(characters,Month,1) ;
Day = SUBSTR(ToDay,7,2) ;

Day = SUBSTR(characters || numbers,Day,1) ;
NOW = TIME() ;
Hour = SUBSTR(NOW,1,2) ;
IF Hour = '00' THEN Hour = '0'
ELSE
Hour = SUBSTR(characters,Hour,1) ;
Minute = SUBSTR(NOW,4,2) ;
second = SUBSTR(NOW,7,2) ;
Unique_Name = Year || Month || Day || Hour ||,
Minute || second ;
SA= "Unique Member name is " Unique_Name

Return Unique_Name
Loading