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

Need help in understanding EXEC CICS Load


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

New User


Joined: 12 Mar 2010
Posts: 64
Location: India

PostPosted: Thu Aug 12, 2010 7:30 pm
Reply with quote

I am new to CICS and I have the following code in my COBOL program:


Code:
EXEC CICS LOAD
                PROGRAM('BCE208OT')
                SET(ADDRESS OF LKBE-TABLE)
                HOLD
END-EXEC



and program BCE208BT is as follows:


Code:
BCE208OT CSECT
                 DC    C'****** START OF KBE TABLE ******'
                 DS    F                         NUMBER OF TABLE ENTRIES
KBETABLE         DS    200CL40              200 40 BYTE ENTRIES
                 DC    C'******  END OF KBE TABLE  ******'
                 END



I want to know is it necessary to write BCE208BT in assembler.
Can BCE208BT be written in COBOL? If yes, how?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Aug 12, 2010 7:34 pm
Reply with quote

Quote:
I want to know is it necessary to write BCE208BT in assembler.
yes
Quote:

Can BCE208BT be written in COBOL? If yes, how?
can't
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Aug 12, 2010 7:46 pm
Reply with quote

now, an analysis of BCE208BT needs to be done.

how is it used in your program?
is it used by other programs?

Since it can not be updated,
and contains no data,
it appears to be a hold-over from older cics where storage was a premium.

depending upon how it is used, it could be replaced by
  • an internal cobol table (internal to your cobol program)
  • getmain
Back to top
View user's profile Send private message
Amb

New User


Joined: 12 Mar 2010
Posts: 64
Location: India

PostPosted: Thu Aug 12, 2010 8:04 pm
Reply with quote

Thanks for the quick response.

I just wanted to know if we can write a COBOL program in the program parameter of the EXEC CICS LOAD statement

So can I conclude that BCE208BT Program in EXEC CICS LOAD statement should be written in assembler only.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Aug 12, 2010 8:08 pm
Reply with quote

Quote:

I just wanted to know if we can write a COBOL program in the program parameter of the EXEC CICS LOAD statement


a quick look of the manual would tell you, that that is correct.
there is more than 1 reason to LOAD a program, or load anything.

if the purpose is to load an assembler table via the LOAD API, then yes,
the user-prepared table needs to be written in assembler.

you need to read the manual before making too many conclusions.
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: Thu Aug 12, 2010 8:13 pm
Reply with quote

How does the number of entries in the CSECT get populated?

This will not yield itself as Threadsafe.

If you change -

Code:

BCE208OT CSECT
                 DC    C'****** START OF KBE TABLE ******'
                 DS    F                         NUMBER OF TABLE ENTRIES
KBETABLE  DS    200CL40              200 40 BYTE ENTRIES
                 DC    C'******  END OF KBE TABLE  ******'
                 END

to -

Code:

BCE208OT  CSECT
          DC    C'****** START OF KBE TABLE ******'
          DC    A(KBETABLN/40) NUMBER OF TABLE ENTRIES
KBETABLE  DS    200CL40        200 40 BYTE ENTRIES
KBETABLN  EQU   *-KBETABLE     LENGTH OF TABLE-RELATED STG
          DC    C'******  END OF KBE TABLE  ******'
          END

Then, the fullword will always be correct after Assembly and will resolve to 200.

Is there a particular reason why there are static literals surrounding the table information?

I trust the DSECT (COBOL LINKAGE COPYBOOK) are defined for these?

But, they don't make any sense, unless they're used as eyecatcher's....

Bill
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: Fri Aug 13, 2010 12:43 am
Reply with quote

I see that you're issuing a LOAD PROGRAM HOLD. Are you using HOLD because you're then loading the 200 entries with data?

Note that when you use HOLD, the table becomes permanent in memory, unless you issue a RELEASE PROGRAM.

How do other programs/tasks know whether the table has been loaded or is in the process of being loaded? You can really cause some serious EUDSA shortages if many other tasks issue a HOLD as well.

Then, you'll having many copies of this table in memory.

There's a better way to make the table core-resident and that's to use a PLT-PI program, which issues a START of a TRANSID and then this transid is invoked when CICS receive control and loads the table with data in background.

In the PPT entry, have your Tech Support personnel define this table as core-resident.

It will be a better use of resources....

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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Aug 13, 2010 12:55 pm
Reply with quote

Quote:
How do other programs/tasks know whether the table has been loaded or is in the process of being loaded? You can really cause some serious EUDSA shortages if many other tasks issue a HOLD as well.

Then, you'll having many copies of this table in memory.

This would apply where the program is defined with RELOAD=YES. With RELOAD=NO, once the program has been loaded, subsequent EXEC CICS LOADs will return the memory address of the already-loaded program.

Garry.
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: Fri Aug 13, 2010 3:23 pm
Reply with quote

Quote:
This would apply where the program is defined with RELOAD=YES. With RELOAD=NO, once the program has been loaded, subsequent EXEC CICS LOADs will return the memory address of the already-loaded program.

Garry.

Yes, should have elaborated on this more....

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

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Sat Aug 14, 2010 5:37 am
Reply with quote

FYI:
it is possible to write a cobol program to load the assembler table
and access its values.

The how requires understanding the layout of the assember table
and maybe a good CICS contract programmer to write it.

icon_cool.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Aug 14, 2010 1:39 pm
Reply with quote

FYI

The Topic Starter Originally wrote:
I want to know is it necessary to write BCE208BT in assembler.
Can BCE208BT be written in COBOL? If yes, how?


The TS already has a COBOL program loading an Assembler Table.
He wants to know if the table, to be loaded by the CICS LOAD API,
can be written in COBOL......
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Sat Aug 14, 2010 5:55 pm
Reply with quote

Truth be known, in a prior life I actually DID encounter one situation in which a CICS program did a CICS LOAD(xxxx) of a table where xxxx was a COBOL program. The "actual" data for the table, however was offset from the load point by some 200+ bytes. Reason? the stuff inherent in a COBOL module that exists prior to the actual WORKING-STORAGE data in the executable module.
Of course, every time the COBOL table program was recompiled, even if just to change an argument or result value, the offset had to be determined anew due to compiler differences, and the COPYBOOK for the table used by the CICS program had to be changed to reflect the new offset, followed by a recompile of the CICS program as well.

Needless to say, I re-wrote the table module in Assembler so that the table always started at offset zero. Then the COPYBOOK only had to be updated for layout changes.

That need to redetermine the offset in a COBOL table is why LOADed tables should be written in assembler and not COBOL.
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 Load new table with Old unload - DB2 DB2 6
No new posts How to load to DB2 with column level ... DB2 6
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
Search our Forums:

Back to Top