IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

CICS programs - NODYNAM compiler options.


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
venktv

New User


Joined: 29 Mar 2006
Posts: 59
Location: Montreal

PostPosted: Mon Jul 19, 2010 7:22 pm
Reply with quote

PGM-1 is main CICS programs calling another CICS program PGM-2
PGM-1 compiled with RENT,NODYNAM,LIB

statements in PGM-1
05 Var-1 PIC X(08) VALUE 'PGM-2'

CALL Var-1 USING BY REFERENCE
DFHEIBLK, CA-COMMAREA,
Copybook1,
Copybook2,


PGM-2 again calling another DB2 program PGM-3
PGM-2 compiled with RENT,NODYNAM,LIB

statements in PGM-2
05 Var-2 PIC X(08) VALUE 'PGM-3'

CALL Var-2 USING USING Copybook3
Copybook4
copybook5

Now, we are making changes to PGM-2, i.e. changing a working storage constant.
These programs are compiled with NODYNAM option, however used variables in CALL statements, so do i need to recompile and linkedit PGM-1 and PGM-3 along with PGM-2 to make the changes effective, please advise, thanks in advance.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Mon Jul 19, 2010 7:48 pm
Reply with quote

CICS/COBOL programs MUST be compiled with NODYNAM.

When CALLING a CICS program, regardless of the language, the normal parmlist is - DFHEIBLK, DFHCOMMAREA, "WHATEVER".

When a CICS/COBOL program is compiled, USING DFHEIBLK DFHCOMMAREA is automatically suffixed to the PROCEDURE DIVISION statement.

You need to change your CALL statement, to include DFHCOMMAREA as the second parameter.

Bill
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Jul 19, 2010 7:50 pm
Reply with quote

Since PGM-2 and PGM-3 are called 'dynamically' (despite the NODYNAM), no.
You can verify that by looking at the link map for PGM-1 and PGM-2 and find no static binding for PGM-2 and PGM-3 respectively.

Use DYNAM to cause nonnested, separately compiled programs invoked through the CALL literal statement to be loaded for CALL, and deleted for CANCEL, dynamically at run time. (CALL identifier statements always result in a runtime load of the target program and are not affected by this option.)
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Jul 19, 2010 7:51 pm
Reply with quote

Bill O'Boyle wrote:
CICS/COBOL programs MUST be compiled with NODYNAM.

End of story....

Bill
And how is that an answer to the asked question?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Mon Jul 19, 2010 7:56 pm
Reply with quote

I was emphasizing this fact because sometimes, people can get bad information from other's (such as management types).

But yes, I didn't delve into his question....

Bill
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jul 19, 2010 8:10 pm
Reply with quote

Three simple rules:
  1. programs written with CICS API's should always be NODYNAM.
  2. Programs written to be invoked from COBOL CALL's - which don't contain CICS API's - should be DYNAM.
  3. you should not COBOL CALL a module that has CICS API's.
Back to top
View user's profile Send private message
venktv

New User


Joined: 29 Mar 2006
Posts: 59
Location: Montreal

PostPosted: Mon Jul 19, 2010 9:21 pm
Reply with quote

Hi everybody,

Thanks very much for the valuable suggestions.

Regards
Venkat
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Mon Jul 19, 2010 9:31 pm
Reply with quote

dbzTHEdinosauer wrote:
Three simple rules:
  1. programs written with CICS API's should always be NODYNAM.
  2. Programs written to be invoked from COBOL CALL's - which don't contain CICS API's - should be DYNAM.
  3. you should not COBOL CALL a module that has CICS API's.


Dick,

Bullet point one is correct.

Bullet point two may or may not work. I've never tried calling a DYNAM compiled program from CICS. It will probably work, providing the sub-program does not CALL another sub-program. If there is a subsequent CALL, then those results are unpredictable.

Bullet point three. It's perfectly OK to CALL CICS programs, providing that the first two parameters are DFHEIBLK and DFHCOMMAREA. They are parm-addresses 01 and 02 off the R1 parmlist.

A CICS sub-program can determine how it's been accessed by checking (as the first line of code in the program), the contents of EIBRSRCE. If it's equal to the sub-program name, then it was accessed via a LINK-API. Otherwise, it has been CALLED.

Bill
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jul 19, 2010 10:37 pm
Reply with quote

point 3, thanks for the update.

point 2, believe me - we have written subsystems, cobol called from a cics module, that dynamically call cobol modules, sometimes upto 18 deep.

only thing about point 2, we have found that linkage structures should not exceed 4k. can have multiples, but we found 4k max per structure was best.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Jul 19, 2010 10:44 pm
Reply with quote

Dick, I hear you there! Back when I worked for a software vendor, we had a limit of 1500 bytes being passed to a subroutine. After the design was changed to allow up to 9999 bytes and the system shipped to customers, we found a S0C4 occurred. The customer's program, which called ours, was passing less than 4K and using 1 4-byte address for that data. Our program now expected 9999 bytes and was using 3 4-byte addresses. This messed up the linkage conventions, to say the least, and caused the S0C4.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts How I Found a Bug in a FORTRAN Compiler All Other Mainframe Topics 4
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
No new posts Parallelization in CICS to reduce res... CICS 4
Search our Forums:

Back to Top