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 redefine the 01 level varialbels in FD Section

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    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

the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
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

Site Director


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

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: 61
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

Global Moderator


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

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

Site Director


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

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
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 Syncsort TPF Level Majid Hussain SYNCSORT 2 Wed Apr 13, 2016 2:22 am
No new posts Need a logic to validate the data in ... sandeep kumar302 COBOL Programming 17 Mon Feb 01, 2016 3:30 pm
No new posts DB2 10.1 Share level locking and Sele... Mary Lewis DB2 1 Wed Apr 15, 2015 9:51 pm
No new posts Redefine Numeric to Alphanumeric suraaj COBOL Programming 4 Mon Oct 06, 2014 9:16 pm
No new posts CICS SE Level Openings in Accenture enikhilk Mainframe Jobs 0 Mon Sep 01, 2014 6:39 pm


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