Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Loading assembler table in COBOL Batch module

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
guy jax

New User


Joined: 05 Feb 2015
Posts: 2
Location: USA

PostPosted: Mon Mar 16, 2015 4:58 am    Post subject: Loading assembler table in COBOL Batch module
Reply with quote

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
View user's profile Send private message

Bill O'Boyle

CICS Moderator


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

PostPosted: Mon Mar 16, 2015 4:35 pm    Post subject: Reply to: Loading assembler table in COBOL Batch module
Reply with quote

Review the following -

http://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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Tue Mar 17, 2015 10:15 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Mar 18, 2015 1:14 pm    Post subject: Reply to: Loading assembler table in COBOL Batch module
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Wed Mar 18, 2015 7:02 pm    Post subject:
Reply with quote

Bill,

Yes all of the programs handle I/O and any other type of errors in this shop.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Mar 18, 2015 7:47 pm    Post subject: Reply to: Loading assembler table in COBOL Batch module
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Wed Mar 18, 2015 8:02 pm    Post subject:
Reply with quote

Bill,

Yes I did write an Abend handler here just for some of these reason.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Mar 18, 2015 8:22 pm    Post subject: Reply to: Loading assembler table in COBOL Batch module
Reply with quote

OK, thanks. Now future readers will know.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
This topic is locked: you cannot edit posts or make replies. MIPS reduction for Batch job Virendra Shambharkar All Other Mainframe Topics 8 Mon Nov 07, 2016 4:02 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us