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

Can we redefine the 01 level varialbels in FD Section


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

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Thu May 08, 2008 11:14 am
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
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Thu May 08, 2008 11:39 am
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

Moderator Emeritus


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

PostPosted: Thu May 08, 2008 11:59 am
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: 61
Location: Coimbatore

PostPosted: Thu May 08, 2008 12:13 pm
Reply with quote

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

Global Moderator


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

PostPosted: Thu May 08, 2008 4:35 pm
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

Moderator Emeritus


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

PostPosted: Fri May 09, 2008 3:43 am
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
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 COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts How to load to DB2 with column level ... DB2 6
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts FD Section to Create FB or Vb File Dy... COBOL Programming 1
Search our Forums:

Back to Top