Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
use of Redefines and Occurs Cluase

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Thu Mar 13, 2008 6:34 am    Post subject: use of Redefines and Occurs Cluase
Reply with quote

hi all,

I am a new commer in mainframe having an experience of 1 year only.

I have to make a few changes in an existing program. My changes are compiling fine. But i am getting error for few other statement in the program. The statement are as follows:

01 WS-MESSAGE-TABLE.
* A00002 - 1
03 FILLER PIC X(160) VALUE
' XXXXXXXXXX TO XXXXXXXXXX '.
* A00003 - 2
03 FILLER PIC X(160) VALUE
'xxxxxxxx to xxxxxxxxxx '.
* A00004 - 3
03 FILLER PIC X(160) VALUE
'From xxxxxxxxxx to xxxxxxxxxx '.
* A00001 - 4
03 FILLER PIC X(160) VALUE
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'.
* A00002 - 5
03 FILLER PIC X(160) VALUE
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'.

01 WS-MESSAGE-ARRAY REDEFINES WS-MESSAGE-TABLE.
03 WS-MSG OCCURS 5 PIC X(160).

Here the grouped data WS-MESSAGE-TABLE is redefined by WS-MESSAGE-ARRAY and the OCCURS clause is also used in the same.

According to my knowledge there should not be any OCCURS clause with redefines, but the code is running in our production but is giving error while compiling.

Please Help,
Nirmal
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Mar 13, 2008 8:14 am    Post subject:
Reply with quote

You can't redefine an 01 level, other than that it is fine. Why is it in production if it is getting a compile error?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Mar 13, 2008 8:24 am    Post subject:
Reply with quote

I have to correct myself, you can redefine an 01. That's what I get for answering questions late at night.
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 Mar 13, 2008 8:33 am    Post subject:
Reply with quote

Hello,

Quote:
According to my knowledge there should not be any OCCURS clause with redefines,
This knowledge is incorrect.

The bit of code you posted looks ok, but you need to post code using the "Code" tab near the top of the reply panel.

If you want help, you need to post the complete error messgae(s) given by the compile. . .
Back to top
View user's profile Send private message
r.mishra

New User


Joined: 12 Mar 2008
Posts: 4
Location: pune

PostPosted: Thu Mar 13, 2008 9:47 am    Post subject: Reply to: use of Redefines and Occurs Cluase
Reply with quote

in given code redefines claused is used on 01 level and ocurrs is at 03 level so i think it will work .
Back to top
View user's profile Send private message
Help-Me-Out

New User


Joined: 09 Dec 2006
Posts: 56
Location: Pune

PostPosted: Thu Mar 13, 2008 9:57 am    Post subject:
Reply with quote

It should not be problem with the above code.

Could you plz provide the compilation error. that helps to understand the exact cause
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Thu Mar 13, 2008 10:18 am    Post subject:
Reply with quote

Hi



Quote:
01 WS-MESSAGE-ARRAY REDEFINES WS-MESSAGE-TABLE.
03 WS-MSG OCCURS 5 PIC X(160).



01 level can be used in the WORKING-STORAGE SECTION for REDEFINES but it cannot be used in DATA DIVISION OF FD description

and also the above code is correct you are using OCCURS in 03 level and used another variable like WS-MSG which is not redefined. so it should work.

otherwise send us your compiler source listing.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Multiple OCCURS depending on in same ... muralirajansm COBOL Programming 6 Fri Aug 21, 2015 4:23 pm
No new posts Another redefines in COBOL RahulG31 COBOL Programming 1 Fri Mar 20, 2015 4:09 am
No new posts Syncsort - help needed with ICETOOL O... ramas.kamal SYNCSORT 2 Wed Apr 16, 2014 4:17 pm
No new posts WHY SQLCODE -508 occurs if COMMIT bet... dejunzhu DB2 5 Fri Nov 08, 2013 7:30 am
No new posts Reading a PS file when abend occurs Kmr.deepakcs COBOL Programming 15 Wed Oct 30, 2013 12:17 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us