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

Using the 2 copybooks under one file name


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
willsdonaldabc

New User


Joined: 05 Oct 2010
Posts: 10
Location: chennai

PostPosted: Sat Jul 30, 2011 12:12 pm
Reply with quote

In the cobol code, 2 copybooks are declared under one file. That means does it take the structure of file combindly both files or individulally ? could you plz anyone explain me detail?
ex:
01 DFHCOMMAREA.
COPY A5XLSWB0.
COPY C5XLSWB0.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Jul 30, 2011 1:31 pm
Reply with quote

[quote="willsdonaldabc"]In the cobol code, 2 copybooks are declared under one file. That means does it take the structure of file combindly both files or individulally ? could you plz anyone explain me detail?
ex:
[quote]

After you have done the formatting for pieces of code, samples of data, etc, highlight that block of text, click on the Code button (above) the input area. Click on the Preview button to check it looks OK, amend as necessary.

In the example you give, there is no file. Maybe you just didn't included it, but I think it more likely DFHCOMMAREA is in the working-storage or linage sections, as it is to do with CICS, not any filess.

If you have an 01 level in Cobol, then anything with a lower level number is part of the group-item defined by the 01. This is irrespective of whether it comes from a copybook, or is just written in your code.

We are unable to tell from your example, but if both the copybooks are without 01 levels, then all the data definitions will belong to the 01 DFHCOMMAREA.

If the copybooks both have 01 levels in, then they both define their own seperate groups, with no relation to each other (unless the second has a REDEFINES of the first). You will get a diagnostic message from the compiler, because DFHCOMMAREA will have no storage defintitions.

If the first has 01 and the second not, then all the data in the copybooks will be part of the 01 which is defined. You will again get a diagnostic message for DFHCOMMAREA.

If the second has an 01 and the first not, the data in the first will belong to DFHCOMMAREA and the second 01 level will define its own storage (subject to lack of REDEFINES).

If you get to an actual file the situation is generally the same if you bear this in mind. Subordinate to an FD, 01 levels implicitly redefine the first 01 level of that FD. This is how you do multiple record layouts for files which are not of a single record-type.
Back to top
View user's profile Send private message
willsdonaldabc

New User


Joined: 05 Oct 2010
Posts: 10
Location: chennai

PostPosted: Sat Jul 30, 2011 3:32 pm
Reply with quote

Thank you very much for Quick reply
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Jul 30, 2011 3:43 pm
Reply with quote

No problem.

I can't believe that every time I suggest to others to use the Preview, and I then don't, I've screwed it up. Like clockwork. Typical!
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Jul 30, 2011 5:08 pm
Reply with quote

Bill Woodger wrote:
No problem.

I can't believe that every time I suggest to others to use the Preview, and I then don't, I've screwed it up. Like clockwork. Typical!


when you show me someone who does not make mistakes
you are showing me someone who does not do anything.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Jul 30, 2011 5:43 pm
Reply with quote

dbzTHEdinosauer wrote:
[...]

when you show me someone who does not make mistakes
you are showing me someone who does not do anything.


I like to add "and I do lot of things" :-)

However, I'm supposed to learn from the mistake, not keep making the same one :-)
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Jul 30, 2011 6:21 pm
Reply with quote

Bill -- "practice makes perfect"? icon_biggrin.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Jul 30, 2011 7:47 pm
Reply with quote

Hi Bill,

Quote:
not keep making the same one
At least you're consistent (not to be confused with stubborn) - this also makes for easier problem resolution. . . icon_smile.gif

d
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Jul 30, 2011 8:32 pm
Reply with quote

Maybe subconciously I keep trying it unchanged, in the hope it'll work this time :-)

I found some nice jokes on the web about that particular phenomenon.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top