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

Eliminating blank space in XML parsed by COBOL

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

New User

Joined: 10 Nov 2015
Posts: 26
Location: USA

PostPosted: Tue Feb 11, 2020 4:41 am
Reply with quote

Hi Team,

I saw a similar issue in the forum where solution was never posted.

I have "XML GENERATE" in COBOL which works fine. Some of my elements in the structure for XML conversion can have empty values after they are mapped to an input file. For example, the XML structure is

01 cardRecord.
05 addrLine1 PIC X(20).
05 addrLine2 PIC X(20).
05 name PIC X(30).
05 businessName PIC X(26).

Here,after mapping this to the i/p XML file, I have non-empty values in addrLine1,addrLine2,name whereas my businessName field has empty values.

Is there any way for me to prevent the tag having empty values not getting displayed after XML-GENERATE statement like this ?

<businessName> </businessName>
(Note there is a blank space)

Please let me know if any more details are required.

Original post -

I am planning to suggest move NA to the attribute value for tag "businessName" if happens to be blank. Is this a good approach?

Also, if the suggested approach is not good, how do I eliminate that blank space from
<businessName> </businessName>

Many Thanks for all your help and support!
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 how to convert and use 1 bit hex-numb... COBOL Programming 10
No new posts VB file copy COBOL program gives erro... COBOL Programming 3
No new posts Cobol program to determine the sequen... COBOL Programming 2
No new posts COBOL 6.2 vs 6.3 COBOL Programming 1
This topic is locked: you cannot edit posts or make replies. COBOL-Common routine that contains al... COBOL Programming 4
Search our Forums:

Back to Top