View previous topic :: View next topic
|
Author |
Message |
seman18
New User
Joined: 08 Feb 2009 Posts: 67 Location: hz
|
|
|
|
I am a new CICS coder, and When I read existing code in our company,
I found several way to include copybook, and could some guys let me know how to use them?
the following usage is standard or just in our company, could someone let me know?
and is there any other way to include copybook?
1. %include xxx //xxx could be copybook that conatins constants
2. %include dd1(xxx) // xxx could be copybook that contains structure
3. %include mm1(xxx) //xxx is the map name |
|
Back to top |
|
|
seman18
New User
Joined: 08 Feb 2009 Posts: 67 Location: hz
|
|
|
|
oh, sorry, I forgot to state that we use PL/1 |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
There are several was to include copybooks.
Standard for Cobol is COPY
Standard for PL/1 is %INCLUDE
Panvalet uses ++INCLUDE
others may exist. Check your source management documentation.
Garry. |
|
Back to top |
|
|
seman18
New User
Joined: 08 Feb 2009 Posts: 67 Location: hz
|
|
|
|
I just don't know when should I use mm1,dd1 or just include some copybook directly? |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
That depends on what's in mm1 and dd1. From the fact that you mention mapname and that this was originally in CICS forum, I suspect that this is a BMS MAP question.
The output from the TYPE=DSECT assembly of map source is a copybook which reflects the structure of the map. This is what you want to %INCLUDE in your source.
What generates the mm1? Is this the SYSLMOD from assembly of the TYPE=MAP? If so, this is a load module and does not go into your program but is a separate program (map) entry in CICS tables.
Garry. |
|
Back to top |
|
|
seman18
New User
Joined: 08 Feb 2009 Posts: 67 Location: hz
|
|
|
|
Please correct me if misunderstanding
1. %include xxx //xxx could be system copybook, like DFHAID, it could be included directly
eg:
%include DFHAID;
2. %include dd1(xxx) // xxx could be copybook that contains structure
eg:
DCL 1 xxx STATIC,
%INCLUDE DD1(yyy); //yy is a structure
3. %include mm1(xxx) //xxx is the map name where type=dsect, it is used to include generated symbolic map
eg:
%include MM1(xxxx) |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
That's correct.
Garry. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
Oopss, sorry. Just spotted the "STATIC" in your map declaration.
Do NOT use STATIC in CICS. This goes against re-entrancy.
Garry. |
|
Back to top |
|
|
seman18
New User
Joined: 08 Feb 2009 Posts: 67 Location: hz
|
|
|
|
thx, is there any other usage like dd2 or something like that?till now, I just found three way to include like I mentioned above |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
The COPY INCLUDE specifies just the member-name. The PDS name(s) is/are given in the step's SYSLIB concatenation.
Garry. |
|
Back to top |
|
|
seman18
New User
Joined: 08 Feb 2009 Posts: 67 Location: hz
|
|
|
|
thx for your explain |
|
Back to top |
|
|
seman18
New User
Joined: 08 Feb 2009 Posts: 67 Location: hz
|
|
Back to top |
|
|
seman18
New User
Joined: 08 Feb 2009 Posts: 67 Location: hz
|
|
|
|
If using changeman to compile code, you don't need write JCL where define ddname for copybook dataset.
so we can use the ddname provided by IBM changeman,like dd1,mm1 |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
First you need a dd statement with trhe ddname of the PDS which containns the copybook members - e.g. ABC.COPYBOOK.PL1 which contains, say, members COPY0001 and COPy0002. This libray is in your SYSLIB concatenation as
Code: |
//SYSLIB DD DISP=SHR,DSN=ABC.COPYBOOK.PL1 |
in your program, you would include these by coding
Code: |
%INCLUDE COPY0001 ;
%INCLUDE COPY0002 ; |
Garry |
|
Back to top |
|
|
seman18
New User
Joined: 08 Feb 2009 Posts: 67 Location: hz
|
|
|
|
thanks very much, Garry |
|
Back to top |
|
|
|