Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Can we redefine the 01 level varialbels in FD Section

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
Pons

New User


Joined: 25 May 2007
Posts: 32
Location: Coimbatore

PostPosted: Thu May 08, 2008 11:14 am    Post subject: Can we redefine the 01 level varialbels in FD Section
Reply with quote

I got an compilation error saying that,

FD FILE1-DATA
RECORDING MODE F
BLOCK CONTAINS 0 RECORDS.
01 S1-FILE1-DATA PIC X(400).
01 WS-USING-FILE1 REDEFINES S1-FILE1-DATA.
.lots of 05 variables
.
.
.

A "REDEFINES" clause was found in the definition of a level-01 item in the "FILE SECTION" discarded.

But it is possble in Working storage section. Why its not accept in FD Section?
Back to top
View user's profile Send private message
References
PostPosted: Thu May 08, 2008 11:14 am    Post subject: Re: Can we redefine the 01 level varialbels in FD Section Reply with quote

the_gautam

Active User


Joined: 05 Jun 2005
Posts: 169
Location: Bangalore

PostPosted: Thu May 08, 2008 11:39 am    Post subject:
Reply with quote

as per my knowledge, REDEFINES is not allowed at 01 level in the FILE-SECTION.
we can use it at some other levels provided the length should be less or equal to the original variable.
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 6728
Location: 221 B Baker St

PostPosted: Thu May 08, 2008 11:59 am    Post subject:
Reply with quote

Hello,

Multiple level 01s in an FD are redefined. You may not code REDEFINES. Look at your compile output and you will see that all of the 01s for an FD start at the same address.
Back to top
View user's profile Send private message
Pons

New User


Joined: 25 May 2007
Posts: 32
Location: Coimbatore

PostPosted: Thu May 08, 2008 12:13 pm    Post subject: Reply to: Can we redefine the 01 level varialbels in FD Sect
Reply with quote

How to see the address in the compile output...
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1050
Location: germany

PostPosted: Thu May 08, 2008 4:35 pm    Post subject:
Reply with quote

open you eyes and look at the compile output.

helps if you have map or object as a compile parm.

if you don't know what that is, look at any cobol manual under how to compile and parms.

while you are in this manual (first time?) take a gander at the sections describing how a coder/programmer build the file section.
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 6728
Location: 221 B Baker St

PostPosted: Fri May 09, 2008 3:43 am    Post subject:
Reply with quote

Hello,

Quote:
How to see the address in the compile output...
Scroll to the right of the 01 - displacements/addresses are usually shown there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1