Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Using the 2 copybooks under one file name

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Using the 2 copybooks under one file name
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Sat Jul 30, 2011 1:31 pm    Post subject: Re: Using the 2 copybooks under one file name
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    Post subject:
Reply with quote

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Sat Jul 30, 2011 3:43 pm    Post subject: Reply to: Using the 2 copybooks under one file name
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    Post subject: Re: Reply to: Using the 2 copybooks under one file name
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Sat Jul 30, 2011 5:43 pm    Post subject: Re: Reply to: Using the 2 copybooks under one file name
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: 7931
Location: Bellevue, IA

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

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

Site Director


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

PostPosted: Sat Jul 30, 2011 7:47 pm    Post subject: Reply to: Using the 2 copybooks under one file name
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Sat Jul 30, 2011 8:32 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us