View previous topic :: View next topic
|
Author |
Message |
Pons
New User
Joined: 25 May 2007 Posts: 61 Location: Coimbatore
|
|
|
|
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 |
|
|
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Pons
New User
Joined: 25 May 2007 Posts: 61 Location: Coimbatore
|
|
|
|
How to see the address in the compile output... |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|