Hi Nelson, John,
This is why I always fell back to having a test server (or virtual server) or at the very least a separate copy of an account (with all programs cataloged locally) so that whole suites of things can be changed and tested without impacting what's running live.
I can't hide the fact that this is me <g> and I have a product that works just such a way--and where all the bits and pieces changed in the dev/test environment are tracked and can be deployed/revoked easily--but even if you're writing down the things you change on a napkin, having a separate test environment always felt right / safest to me, if it's doable. I suspect something about this is NOT doable in your environment?
John's idea of a flag is smart (as are most of John's ideas,) but does still involve renaming and keeping track of what's been renamed. You can build a whole framework like this for a test.mode --I do this for debugging. A bit of infrastructure...
Regards,
Susan Joslyn
SJ+ Systems Associates, Inc.
---- On Sat, 09 Mar 2024 16:39:03 -0800 John Jenkins via Rocket Forum <
mail@forum.rocketsoftware.com> wrote ---
Invite your colleagues to join the Rocket Forum and grow our expert network.
https://community.rocketsoftware.comhttps://community.rocketsoftware.com/forums/forum-home/digestviewer?CommunityKey=dd45d00d-59db-4884-b3eb-2b0647af231bhttp://community.rocketsoftware.com/participate/postmessage?GroupId=49&ListKey=1daf02a1-f0f0-4a5c-a95d-a2b9f11dcf4b https://community.rocketsoftware.com/registerhttps://community.rocketsoftware.com/discussion/subroutine-selection-when-called-from-a-test-program#bmfac5335d-42ee-4b4d-ba54-018e25bf3745https://community.rocketsoftware.com/forums/all-discussions/postreply?MessageKey=fac5335d-42ee-4b4d-ba54-018e25bf3745&ListKey=1daf02a1-f0f0-4a5c-a95d-a2b9f11dcf4bmailto:
ROCKET_universe_fac5335d-42ee-4b4d-ba54-018e25bf3745@ConnectedCommunity.org?subject=Re: Subroutine selection when called from a test program
https://community.rocketsoftware.com/network/members/profile?UserKey=c15fa180-b7cc-429c-93e9-17509c3c3b68Mar 9, 2024 7:39 PM
https://community.rocketsoftware.com/network/members/profile?UserKey=c15fa180-b7cc-429c-93e9-17509c3c3b68Nelson,
I've been burmed by this - when someone removes a catalogued entry whoch they think is not eamted any more and the order of precedence means that it does not fail on invocation - it just runs a different program.causing a hidden failure. The same can happen if a program of teh same name is catalogued - possibly elsewhere - that sits in a higher order of precedence and hijacks the code you thought was being used.
As a suggestion, rather than having multiple versions of programs with the same name - whihc can be confusing at best - have an array of subroutine names and use CALL @var to call specific individually named subroutine programs - and only have ONE version of any named program or subroutine catalogued in individual accounts. You could also use a control flag to determine whether live or test program names are used as also illustrated below by a named common flag. - e.g.
COMMON /MODE/ RUNTIME.MODE
DIM S.SUBROUTINES(200)
MAT S,SUBROUTINES=''
EQU S.CUST.SUBR TO S.SUBROUTINES(1), S.PAYROLL.CALC.SUBR TO S.SUBROUTINES(20, etc.....
OPEN '',RUN.MODE;'SYSTEM.PARAMS' to F.PARAMS ELSE STOP 'CANNOT OPEN F.PARAMS'
MATREAD S,SUBROUTINES FROM F.PARAMS,'SYSTEM.SUBROUTINES' ELSE STOP 'CANNOT READ SYSTEM.SUBROUTINES FROM SYSTEM.PARAMS'
...
...program logic
...
CALL @S.CUST.SUBR(arg1,arg2,arg3...)
Regards,
JJ
------------------------------
John Jenkins
Thame, Oxfordshire
------------------------------
https://community.rocketsoftware.com/forums/all-discussions/postreply?MessageKey=fac5335d-42ee-4b4d-ba54-018e25bf3745&ListKey=1daf02a1-f0f0-4a5c-a95d-a2b9f11dcf4b https://community.rocketsoftware.com/discussion/subroutine-selection-when-called-from-a-test-program#bmfac5335d-42ee-4b4d-ba54-018e25bf3745 https://community.rocketsoftware.com/forums/all-discussions/forwardmessages?MessageKey=fac5335d-42ee-4b4d-ba54-018e25bf3745&ListKey=1daf02a1-f0f0-4a5c-a95d-a2b9f11dcf4b https://community.rocketsoftware.com/discussion/subroutine-selection-when-called-from-a-test-program?MarkAppropriate=fac5335d-42ee-4b4d-ba54-018e25bf3745#bmfac5335d-42ee-4b4d-ba54-018e25bf3745 http://community.rocketsoftware.com/participate/postmessage?GroupId=49&ListKey=1daf02a1-f0f0-4a5c-a95d-a2b9f11dcf4b
Original Message:
Sent: 03-08-2024 15:46
Original Message:
Sent: 3/9/2024 7:39:00 PM
From: John Jenkins
Subject: RE: Subroutine selection when called from a test program
Nelson,
I've been burmed by this - when someone removes a catalogued entry whoch they think is not eamted any more and the order of precedence means that it does not fail on invocation - it just runs a different program.causing a hidden failure. The same can happen if a program of teh same name is catalogued - possibly elsewhere - that sits in a higher order of precedence and hijacks the code you thought was being used.
As a suggestion, rather than having multiple versions of programs with the same name - whihc can be confusing at best - have an array of subroutine names and use CALL @var to call specific individually named subroutine programs - and only have ONE version of any named program or subroutine catalogued in individual accounts. You could also use a control flag to determine whether live or test program names are used as also illustrated below by a named common flag. - e.g.
COMMON /MODE/ RUNTIME.MODE
DIM S.SUBROUTINES(200)
MAT S,SUBROUTINES=''
EQU S.CUST.SUBR TO S.SUBROUTINES(1), S.PAYROLL.CALC.SUBR TO S.SUBROUTINES(20, etc.....
OPEN '',RUN.MODE;'SYSTEM.PARAMS' to F.PARAMS ELSE STOP 'CANNOT OPEN F.PARAMS'
MATREAD S,SUBROUTINES FROM F.PARAMS,'SYSTEM.SUBROUTINES' ELSE STOP 'CANNOT READ SYSTEM.SUBROUTINES FROM SYSTEM.PARAMS'
...
...program logic
...
CALL @S.CUST.SUBR(arg1,arg2,arg3...)
Regards,
JJ
------------------------------
John Jenkins
Thame, Oxfordshire
------------------------------