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
 

 

Can we use VALUE Clause in the FD Section Copybook.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ramfrom84

New User


Joined: 23 Aug 2006
Posts: 93
Location: chennai

PostPosted: Thu Mar 29, 2007 8:32 pm    Post subject: Can we use VALUE Clause in the FD Section Copybook.
Reply with quote

Hi All,
1.While writing the output File from the FD Section copybook , we use value clause in the copybook, It is not working .

2. Can we use REDEFINE Clause in the FD Section of Cobol Program?

Can anyone answer the above Question...
Back to top
View user's profile Send private message

cooldebi

New User


Joined: 19 Apr 2006
Posts: 18
Location: mumbai

PostPosted: Thu Mar 29, 2007 8:55 pm    Post subject: Re: Can we use VALUE Clause in the FD Section Copybook.
Reply with quote

1. I think Value clause is not allowed at record definition level except for 88 level in that record.

2. Yes, Redefine it just after defining the record.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Thu Mar 29, 2007 9:24 pm    Post subject:
Reply with quote

I would like to add one point.
IF we declare more than one 01 level records in FD section then it is considered implicitely redefined to first 01 level record. icon_smile.gif
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Mar 30, 2007 3:55 am    Post subject:
Reply with quote

Value clauses are "allowed" but ignored by the compiler; i.e. no vals are put into the fields to init them.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Mar 30, 2007 1:52 pm    Post subject:
Reply with quote

Abhijit,

Quote:
more than one 01 level records in FD section then it is considered implicitely redefined to first 01 level record


I dont think it is true. In my project, few of the copybooks has three 01 levels.

For example:

Code:

01  BTRN-PARAMS.
       02  ....
       02  ....
       02  ....

01  BTRN-DATA-LIST.
       02  ....
       02  ....
       02  ....

01  BTRN-DATA-AREA.
       02  ....
       02  ....
       02  ....
            04 ....
            04 ....
            04 ....
       02  ....

Length:
 BTRN-PARAMS= 42,
 BTRN-DATA-LIST = 52  &
 BTRN-DATA-AREA= 400


Do you think (implicit) redefine of 42 byte record to 400 length is possible? Curuious to see your reply.
Back to top
View user's profile Send private message
ramfrom84

New User


Joined: 23 Aug 2006
Posts: 93
Location: chennai

PostPosted: Fri Mar 30, 2007 5:30 pm    Post subject: Re: Can we use VALUE Clause in the FD Section Copybook.
Reply with quote

I think we cannot use REDEFINE and VALUE Clause in the FD Section.
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Fri Mar 30, 2007 6:00 pm    Post subject:
Reply with quote

If you include this copybook after the FD as the records for a file, then that is in fact what you are telling the compiler to do.

If your request to do this has an error, then you'll get an error message.

A copybook means nothing until it is included in your program.

There is only one active record at a time in each open file's buffer, and multiple 01's are in fact, as said above, all valid descriptions. It's up to the programmer to use them correctly.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Mar 30, 2007 6:01 pm    Post subject: Re: Can we use VALUE Clause in the FD Section Copybook.
Reply with quote

ramfrom84 wrote:
I think we cannot use REDEFINE and VALUE Clause in the FD Section.
Why not? I do with perfect success:
Code:
01 record-name
   05 data-area pic x(10).
   05 numeric area redefines
      date-area pic s9(7).

and it works... icon_smile.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 Mar 31, 2007 12:14 am    Post subject:
Reply with quote

Hello,

Multiple level 01s in an FD are always a redefinition. Regardless of the record layouts, they all start at the same memory location. If you have multiple 01s of different lengths in an FD what you have defined is a variable length file.

Many, many files have fields/groups successfully redefined in the FD.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Sat Mar 31, 2007 2:11 pm    Post subject:
Reply with quote

Murali Said:
Quote:
Do you think (implicit) redefine of 42 byte record to 400 length is possible? Curuious to see your reply.

YES!
See the manual/reference book.
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 Copybook structure in Load module Vai123 COBOL Programming 7 Fri Sep 16, 2016 8:29 pm
No new posts Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm
No new posts Geneartion of COBOL copybook structre... murugan_mf COBOL Programming 3 Fri May 20, 2016 12:48 pm
No new posts View Copybook having COPY statement i... nkumar Compuware & Other Tools 6 Mon May 16, 2016 7:28 pm
No new posts JCL Utility in accordance to the copy... meetsupriyo JCL & VSAM 3 Tue Dec 08, 2015 8:46 pm


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