Query on CICS LOAD PROGRAM command



Support for CICS/ESA, CICS/TS & Transaction Gateway, CICS Configuration Manager and CICS Performance Analyzer

Query on CICS LOAD PROGRAM command

Postby huxianjun » Thu Jul 21, 2016 10:50 pm

Hi Everyone

I see a lot codes(to load a data table) as below in our system:

1. First, load the program which is coded in assembly language to Define Constant(DC Instruction) i.e. actually allocate
some main storage space for storing MY-RECORD later(in step 2):
EXEC CICS LOAD
PROGRAM(WS-MYPROG)
SET(ADDRESS OF MY-RECORD)
END-EXEC.
Note: the above codes is to load a data table!

2. Second, read the record from the file/dataset into MY-RECORD:
EXEC CICS READ
DATASET (MY-FILE-NAME)
INTO (MY-RECORD)
RIDFLD (MY-RECORD-KEY)
LENGTH (MY-LENGTH)
END-EXEC.

My question is, for the above process why bother to use LOAD command to load a program/WS-MYPROG to allocate the storage
space, why not directly use GETMAIN to achieve the same? is there additional benefit other than Storage allocation by using
LOAD instead of GETMAIN?

Thanks, Roy
huxianjun
 
Posts: 23
Joined: Thu Jul 21, 2016 10:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Query on CICS LOAD PROGRAM command

Postby Robert Sample » Fri Jul 22, 2016 1:50 am

1. GETMAIN storage, unless you treat it special via the SHARED option, goes away when the task ends. If the storage record is needed past the end of the task, GETMAIN is not usually a good choice. Using SHARED, unless it is definitely deleted via a FREEMAIN at some point, may lead to S-O-S (short-on-storage) conditions for the CICS region.
2. With GEETMAIN storage, you have to keep the address available somehow for whatever programs want to use it. This requires special consideration and use of a TS queue or VSAM data record since the task using the storage may have no relationship to the task that put out the GETMAIN storage (hence passing the address through DFHCOMMAREA wouldn't work). EXEC CICS LOAD PROGRAM is easy, requires no special considerations, and the use count tells you whether or not the data table has been loaded into memory already.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Query on CICS LOAD PROGRAM command

Postby huxianjun » Fri Jul 22, 2016 3:36 am

Thanks Robert for your reply!

So for the EXEC CICS LOAD PROGRAM(name), when it's to load a data table, should the name be a data table name which is connected to a physical data set? and the LOAD command is just to load the content of the data set into main storage?

Thanks, Roy
huxianjun
 
Posts: 23
Joined: Thu Jul 21, 2016 10:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Query on CICS LOAD PROGRAM command

Postby Robert Sample » Fri Jul 22, 2016 6:39 am

The program name is whatever your site decides to call it, subject to the restrictions of program names in CICS. The name may be related to the data set being loaded into memory, or it may not -- that's really an application developer's decision with input from the site support group. Where I've seen it used before is to load a table from VSAM into memory for faster access; a PLT program at start up was used to load the table, and then programs would be able to access the table entries without incurring the overhead of VSAM I/O.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Query on CICS LOAD PROGRAM command

Postby huxianjun » Fri Jul 22, 2016 9:20 am

Thanks Robert!

I think I'm confused by what the manual says that CICS LOAD PROGRAM can be used to load a table also...therefore I confused it's to load a shared data table(defined from a KSDS VSAM file)! However, after checked more I realized LOAD PROGRAM command is to load an assembler data table(defined by the DC Instruction) as a form of shared storage, now my understanding is, the table(defined in assembly language) when being loaded by LOAD PROGRAM has nothing related to any physical data set, instead it just has whatever content coded in the assembly program once it's being loaded by the LOAD PROGRAM command...

Correct me if I'm wrong with the above, I'm trying to concept wise understand the relation between LOAD PROGRAM and CICS Shared Data Tables.

Thanks, Roy
huxianjun
 
Posts: 23
Joined: Thu Jul 21, 2016 10:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Query on CICS LOAD PROGRAM command

Postby Robert Sample » Fri Jul 22, 2016 6:26 pm

I'm trying to concept wise understand the relation between LOAD PROGRAM and CICS Shared Data Tables.
Simply put, there is no relationship. LOAD PROGRAM can be used whether or not shared data tables are in use, and vice-versa. They are used for different purposes -- LOAD PROGRAM creates an in-memory table for a single region whereas shared data tables (as the name implies) can be shared across regions through cross memory services. You use normal CICS file API commands (READ, WRITE, READNEXT) on a shared data table while these commands are NOT used for a LOAD PROGRAM table.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Query on CICS LOAD PROGRAM command

Postby huxianjun » Fri Jul 22, 2016 8:04 pm

Robert - I think my understanding is now aligned with your last reply, many thank!
huxianjun
 
Posts: 23
Joined: Thu Jul 21, 2016 10:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Query on CICS LOAD PROGRAM command

Postby Robert Sample » Fri Jul 22, 2016 8:13 pm

Glad to hear it makes sense to you now.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to CICS

 


  • Related topics
    Replies
    Views
    Last post