If you use quotes, the call is static, unless you use (on the mainframe) a compile option dynamic.
If you use identifiers, so in this example
01 PROGRAM1 PIC X(8) VALUE 'PROGRAM1'.
CALL PROGRAM1
This call is dynamic. At run-time it is clear that you want to call the program with the name 'PROGRAM1' because that is the name inside the variable PROGRAM1.
Hi Crox,
My program sets the date for the system (batch programs). From your answer , i conclude that i have to compile all the programs that call program1. risky job.
thanks again.
A curious thing happened to me on my old job. There, they use IBM MVS/ESA. I needed to call the program 'SYSRACF' for security purposes in the program.
So when I coded it, at first, I made it a dynamic call. I had a WS field coded:
01 PROGRAM-NAME PIC X(8) VALUE SPACES.
The field was defined with 8 bytes because most of our program names had 8 characters in it. But the program name 'SYSRACF' has only 7 bytes.
So I had to make the call to SYSRACF:
MOVE 'SYSRACF' TO PROGRAM-NAME.
CALL PROGRAM-NAME USING CHECK-SECURITY-DATA.
And I got a bad return code. Investigating it further using InterTest (debugging tool for CICS programs), I found that the name being passed was 'SYSRACF[low-value]'.
Of course the system didn't recognize any program called 'SYSRACF[low-value]'. For whatever reason, the final low-value byte wasn't truncated.
But when I made a static call i.e.
CALL 'SYSRACF' USING CHECK-SECURITY-DATA.
It worked just fine. InterTest showed that the system saw the field as 'SYSRACF' without the low-value.
Any ideas as to why this happens, anyone? Curious minds want to know.
Try using a REDEFINES (something like PROGRAM-NAME-7) that's 7 bytes so you don't have to deal with that last byte. Or INITIALIZE PROGRAM-NAME when you begin to ensure it's spaces. Not sure how that low-val is getting in there when the field is defined with spaces...
The problem with initializing it into spaces is that then I get a program name called 'SYSRACF[space]'. Which this system didn't recognize, either. As I recall, I did try initializing the field and that didn't work.
And redefing wouldn't work. Because I still would get 8 bytes and thus get 'SYSRACF[space or low-value]' instead of 'SYSRACF'.
I no longer work for this company, so I no longer have access to their system. Don't know if my current system has this strange quirk; I haven't been given the assignment to call 'SYSRACF' (utility program for RACF security system). But if I ever do, I'll make it a static call.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.