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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CISC PROGRAM TO CALL BY CTG COBOL PROGS

Status
Not open for further replies.

botrero

Programmer
Jul 29, 2010
1
IT
The problem is:

Invoke by Java-CTG e CICS program and by this prog call other cobol programs.

The java part is solved.
The problem is how to build a unique CICS program Driver to call other cobol progs:

This is the CICS Driver PRog:

LINKAGE SECTION.
01 DFHCOMMAREA.
02 PROG-NAME PIC X(8).
02 PROG-AREA-LEN PIC 9(5).
02 PROG-AREA PIC X(32000).

PROG-NAME is the name of cobol program to CALL
PROG-AREA-NAME is the size of COMMAREA of PROG-NAME

How to call PROG-TO-CALL using the PROG-AREA with size PROG-AREA-LEN ???

this is not working:
CALL NOME-PROGRAMMA USING AREA-PROGRAMMA(1:LEN-AREA-PROGRAMMA)


what to do ?

thanks...
 
Unfortunately, this is a pretty awkward requirement given how a mainframe environment works. Generally specific sizes are expected in calls (which is why your reference modification fails, probably in compilation) and range/size checking exists for good reasons. Add to that the fact that the environment expects fixed sizes for parameters, and you're going to have a huge problem. Generally, you'll have to pass the largest value possible to this driver program and through to your subroutine.

Possible ideas:
1) Recode the driver program to handle specific programs. But if you do that, you might as well have the main code call the COBOL programs instead of the CICS one.

2) Play around with the idea of passing pointers. I haven't done this with COBOL, but with other languages you pass the pointer, and the subprogram has to resolve that to its known data block. But that kind of obfuscates things and the other group/team members might not like it.

3) Probably the most straight forward and acceptable to most solution if the main has to have a CICS program is to write a stub program which takes the data and then passes it to the COBOL sub and then handles the data on return (if necessary). Not much dev time (copy/paste), but probably a catalogue nightmare if you have very many of these COBOL subroutines.

Good luck, sounds like you could use it.

It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
 
Code:
WORKING-STORAGE.
01  WS-PROG-AREA PIC X(32000).
LINKAGE SECTION. 
01 DFHCOMMAREA. 
02 PROG-NAME PIC X(8). 
02 PROG-AREA-LEN PIC 9(5). 
02 PROG-AREA PIC X(32000). 

MOVE PROG-AREA (1:PROG-AREA-LEN) TO WS-PROG-AREA  
CALL PROG-NAME USING WS-PROG-AREA
MOVE WS-PROG-AREA TO PROG-AREA (1:PROG-AREA-LEN)
Remember, data is not passed, just the address when you use the default BY REFERENCE. If you pass BY CONTENT, you can not get any changes.


- free online Compare/Diff of snippets
 
in an IBM environment, it is possible to use the option EXTERNAL on a 01 working-storage definition. Can this help you out? It is sometimes much easier to use...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top