Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic or static call 4

Status
Not open for further replies.

claudeb

Programmer
Nov 23, 2000
140
CA
Hi,
How do you know if a call to a program is dynamic or not ?
My program is called in this way:
call 'program1' using ....
Thanks
 
Hi,

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.

Regards,

Crox
 
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.
 
For some reason, the changes were taken without recompiling the program that calls mine. another mystery !!
 
Hi,

If you link programs again, you can update the loadmodule without recompiling.

Perhaps your compiler has the option DYNAM active. That means that all the static call's are translated into dynamic calls.

That can be the reason why all the programs seams to be changed...

Regards,

Crox
 
you're once again right.
DYNAM it is.
1000 thanks
 
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.

Nina Too
 
Nina,

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...

Regards
Ed
 
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.

Nina Too

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top