View previous topic :: View next topic
|
Author |
Message |
kedianirmal
New User
Joined: 08 Feb 2008 Posts: 82 Location: Bangalore, India
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
I have to correct myself, you can redefine an 01. That's what I get for answering questions late at night. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
r.mishra
New User
Joined: 12 Mar 2008 Posts: 4 Location: pune
|
|
|
|
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 |
|
|
Help-Me-Out
New User
Joined: 09 Dec 2006 Posts: 56 Location: Pune
|
|
|
|
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 |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
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 |
|
|
|