MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Copybooks with the same 01 level..

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Wed Apr 11, 2007 4:13 am    Post subject: Copybooks with the same 01 level.. Reply with quote

Hi,

I have a strange issue in my requirement.

I have two copybooks.

CPYBK1 and CPYBK2.

The fields are defined as follows:

CPYBK1

Code:
  01 SERVICE-AREA.
       10 VAR1 PIC X(10).
       10 VAR2 PIC X(10).


CPYBK2

Code:
  01 SERVICE-AREA.
       10 VAR1 PIC X(10).
       10 VAR2 PIC X(10).
       10 VAR3 PIC X(10).
       10 VAR4 PIC X(10).


I need to initialize all the fields in both of the copybooks.

My question is that can we qualify the fields at the member level?
i.e., is MOVE SPACES TO SERVICE-AREA OF CPYBK1 valid?

Please suggest me of how to go about this issue.

Thanks in advance.
Vivek G
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Apr 11, 2007 4:54 am    Post subject: Reply with quote

Quote:
My question is that can we qualify the fields at the member level?


member is not a term associated with structures (group items and elementary items). member refers to a Partitioned Dataset, of which your copybook could be a member.

Quote:
i.e., is MOVE SPACES TO SERVICE-AREA OF CPYBK1 valid?


You can only qualify up-to the 01 level. as far as your COBOL prgm is concerned, it knows nothing of CPYBK1 or 2.

You should not have two structures with the same Reference at the 01 level. chg the 01 references to SERVICE-AREA-1 and -2 or something.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed Apr 11, 2007 4:54 am    Post subject: Reply with quote

Before coding any MOVE statements, try compiling with those 2 copy books as specified and you will answer your own question.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Wed Apr 11, 2007 4:59 am    Post subject: Reply with quote

dbzTHEdinosauer, Nic Clouston,

Thanks for your quick responses.

Regards,
Vivek G
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
Sreejith
Intermediate


Joined: 02 Dec 2002
Posts: 155
Topics: 25
Location: N.Ireland

PostPosted: Wed Apr 11, 2007 6:00 am    Post subject: Reply with quote

can you not use the COPY REPLACING for the second copybook
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Apr 11, 2007 8:22 am    Post subject: Reply with quote

Nic Clouston wrote:

Before coding any MOVE statements, try compiling with those 2 copy books as specified and you will answer your own question.


The code DOES compile without any problems. It will compile fine as long as you don't refer those items in your procedure division.

Vivek,

As DBZ already mentioned ,COBOl does not have this member concept, once you use the COPy or include statement , it is embedded into the code and everthing is treated as 1 single program. As sreejith pointed out you can replace one of the copy book to make them unique at 01 level.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group