View previous topic :: View next topic
|
Author |
Message |
guy jax
New User
Joined: 05 Feb 2015 Posts: 2 Location: USA
|
|
|
|
Hi,
I have an assembler table, which is being used in a CICS COBOL module, it is being loaded using an EXEC CICS load command, I want to use the same table in a batch COBOL module.. Is there any way to achieve this… Something like a LOAD EPLOC which simply returns me the table address.
Any pointer would be appreciated… |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Review the following -
ibmmainframes.com/viewtopic.php?p=236741&highlight=#236741
An update to this post -
IBM does not condone the usage of PROCEDURE-POINTER to load external tables, similar to the Assembler LOAD Macro.
The last time it was used (in my case) it work as advertised, but keep in mind if it stops working for whatever reason, IBM may not be there to back you.
HTH.... |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
Code: |
01 WS-TABLE-STORAGE.
05 WS-TABLE-NAME PIC X(08) VALUE 'XXXXXXXX'.
05 WS-TABLE-POINTER USAGE PROCEDURE-POINTER.
05 FILLER REDEFINES WS-TABLE-POINTER.
10 WS-TABLE-ADDRESS USAGE POINTER.
10 FILLER PIC X(04).
05 WS-TABLE-INDEX PIC 9(08) VALUE ZEROES.
05 WS-TABLE-FLAG PIC X(01) VALUE ' '.
88 WS-TABLE-MATCH VALUE 'M'.
88 WS-TABLE-ERROR VALUE 'E'.
05 WS-LOADED-FLAG PIC X(01) VALUE ' '.
88 WS-TABLE-LOADED VALUE 'L'.
88 WS-TABLE-FAILED VALUE 'F'.
LINKAGE SECTION.
your table field layout information here
01 PCT-XXX-TABLE.
05 PCT-XXX-COUNT PIC 9(04) VALUE ZEROES.
05 PCT-XXX-ENTRY OCCURS 0 TO 999 TIMES
DEPENDING ON PCT-XXX-COUNT.
10 PCT-XXX-XXXX PIC X(XX) VALUE SPACES.
10 PCT-XXX-XXXX PIC X(XX) VALUE SPACES.
Procedure Division stuff
SET WS-TABLE-POINTER TO NULLS
SET WS-TABLE-POINTER TO ENTRY WS-TABLE-NAME
IF WS-TABLE-POINTER = NULLS
ERROR
ELSE
SET WS-TABLE-LOADED TO TRUE
SET ADDRESS OF PCT-xxx-TABLE TO WS-TABLE-ADDRESS
END-IF
IF WS-TABLE-LOADED
PERFORM VARYING WS-TABLE-INDEX FROM 1 BY 1
UNTIL WS-TABLE-MATCH OR WS-TABLE-ERROR
DO TABLE MATCHING STUFF HERE
END-PERFORM
END-IF
|
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Mickeydusaor,
Are you using an abend-handler as well? Otherwise what is the purpose of the NULL setting and the test for NULL? If it isn't there, or busted, you'll just get S806 or S706. |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
Bill,
Yes all of the programs handle I/O and any other type of errors in this shop. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Well, what I meant was "Are you using a Language Environment Abend-handler to get control for an S706/S806?"
Code: |
SET WS-TABLE-POINTER TO NULLS
SET WS-TABLE-POINTER TO ENTRY WS-TABLE-NAME
IF WS-TABLE-POINTER = NULLS
ERROR |
Without the abend-handler, if the contet of WS-TABLE-NAME does not exist in the STEPLIB/JOBLIB you will get S806, and if it is not correctly linkedited/bindered you'll get an S706.
With an abend-handler, the SET WS-TABLE-POINTER TO NULLS would be correct, the SET WS-TABLE-POINTER TO ENTRY WS-TABLE-NAME would fail, the abend would be handled, and the WS-TABLE-POINTER would not change, so the IF would work.
Without an abend-handler, those things with the NULLS would be superfluous.
So I assume you have one. Perhaps. |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
Bill,
Yes I did write an Abend handler here just for some of these reason. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
OK, thanks. Now future readers will know. |
|
Back to top |
|
|
|