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
Query on CICS LOAD PROGRAM command
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: Query on CICS LOAD PROGRAM command
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.
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.
-
- Posts: 23
- Joined: Thu Jul 21, 2016 10:10 pm
- Skillset: CICS/COBOL/JCL
- Referer: Google search
Re: Query on CICS LOAD PROGRAM command
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
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
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: Query on CICS LOAD PROGRAM command
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.
-
- Posts: 23
- Joined: Thu Jul 21, 2016 10:10 pm
- Skillset: CICS/COBOL/JCL
- Referer: Google search
Re: Query on CICS LOAD PROGRAM command
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
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
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: Query on CICS LOAD PROGRAM command
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.I'm trying to concept wise understand the relation between LOAD PROGRAM and CICS Shared Data Tables.
-
- Posts: 23
- Joined: Thu Jul 21, 2016 10:10 pm
- Skillset: CICS/COBOL/JCL
- Referer: Google search
Re: Query on CICS LOAD PROGRAM command
Robert - I think my understanding is now aligned with your last reply, many thank!
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: Query on CICS LOAD PROGRAM command
Glad to hear it makes sense to you now.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Find the version of a cobol program through its load module
by vinigim » Fri Oct 30, 2020 3:16 am » in IBM Cobol - 5
- 5140
-
by chaat
View the latest post
Sat Nov 07, 2020 8:40 am
-
-
-
Calling Java program on UNIX/USS from a COBOL CICS program?
by zbius » Tue Nov 05, 2024 2:37 pm » in IBM Cobol - 2
- 2595
-
by zbius
View the latest post
Wed Nov 06, 2024 6:02 pm
-
-
-
Cobol cics command that seems out of context
by nightrider43 » Mon Jul 01, 2024 6:08 pm » in IBM Cobol - 9
- 4115
-
by enrico-sorichetti
View the latest post
Tue Jul 09, 2024 5:32 pm
-
-
- 4
- 2894
-
by Pedro
View the latest post
Sat May 15, 2021 3:39 am
-
-
How to identify ASM load modules in a load lib
by Misha786 » Thu May 16, 2024 7:08 pm » in Assembler - 0
- 2346
-
by Misha786
View the latest post
Thu May 16, 2024 7:08 pm
-