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

Problem when using Redefines


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

New User


Joined: 09 Nov 2006
Posts: 21

PostPosted: Mon Jul 06, 2009 3:32 pm
Reply with quote

Hi,

I am preparing an XML to an external system.
Say i have an 3 records.

I have definition like
10 XML-ORDRE-STATUS-SUCCESS.
15 XML-ORDRE-SUCCES PIC X(21).
15 FILLER PIC X(39)
VALUE '</status>'.

10 XML-ORDRE-STATUS-FAIL REDEFINES XML-ORDRE-STATUS-SUCCESS.
15 XML-ORDRE-FAILED PIC X(17).
15 XML-record PIC X(39) .
15 FILLER PIC X(4).

move </status> is moved to xml-record
I have 3 records
successful
failed
successful

i send xml as below

<status>successful </status>
for 2nd order
<status> failed </status>
for 3rd order
<status> successfulatus

after 2nd record xml for failed is sent. in the 3rd record first 4 characters
of </st> is not coming.

is there a problem with redefines. is there a better way to do?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Jul 06, 2009 4:40 pm
Reply with quote

There's no problem with REDEFINES. There is a problem with the way you're using it, but REDEFINES did exactly what you told it to do. If you check your character count, you'll see the fields don't align. Fix your problem with the alignment and your issue goes away.
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 Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
No new posts Need to add field to copybook, proble... COBOL Programming 14
Search our Forums:

Back to Top