×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Cobol XML Parse from seq.fileFiles

Cobol XML Parse from seq.fileFiles

Cobol XML Parse from seq.fileFiles

(OP)
My XML-input comes from a large seq. file.
Parse seams to want all data in one field!?!?!

There is way to much data for it to reside in the cobol-program all at once.
So what to do, any ideas?

Regards
  

RE: Cobol XML Parse from seq.fileFiles

cobol vendor, os and version of both os and cobol please. as there might be limits/ways of doing things differently depending on those.

but base process is to read each record from the input file, string them into a single variable and then using that variable to as input to the parse statement.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
www.syssoft-int.com

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

RE: Cobol XML Parse from seq.fileFiles

(OP)
Don't remember the version, but it's the latest on the 3090 host mainframe!
Your surguestion is exactly the way I can't do it because of the number of statement in the XML-file! There can be millions of rows in the input-XML dataset!!!

So: what to do???

RE: Cobol XML Parse from seq.fileFiles

Some years ago, I tried XML PARSE on IBM iSeries.
The XML document could be either in one field or in an stream file (in case of iSeries stored in IFS)
The syntax is

CODE

XML PARSE FILE-STREAM xml-id PROCESSING PROCEDURE xml-handler
where

CODE

1 xml-id pic x(27) value '/home/user1/xmlsampldoc.xml'.
see the example in my earlier thread:
http://archive.midrange.com/cobol400-l/200509/msg00002.html
For mainframe specific questions try the IBM manuals.

RE: Cobol XML Parse from seq.fileFiles

(OP)
By the way, my cobol version is: Enterprise COBOL for z/OS V3.4
After reading the manual I first found the following:
"The XML PARSE statement supports XML files encoded in Unicode UTF-16 or any of several single-byte EBCDIC code pages. Support is not provided for ASCII code pages."
But then sadly this:
"If the XML document that you want to parse is held in a file, use ordinary COBOL facilities to place the document into a data item in your program:"

So it seems I have to code my own Parse routine!
But thanks for your help on the matter!!!

Regards
                                      
 

 

RE: Cobol XML Parse from seq.fileFiles

I found out, that I posted my question in 2005 in this forum too smile
http://www.tek-tips.com/viewthread.cfm?qid=1101822

Maybe Enterprise COBOL's XML PARSE statement doesn't have the FILE-STREAM keyword so you need to read the file into a working-storage field before parsing.
 

RE: Cobol XML Parse from seq.fileFiles

(OP)
Type of data??? What do you mean?
Rows containing payments and that kind....
I can not build a solution that doesn't work if the amount of data exeeds 134,217,727 bytes of XML.

I'm currently trying to find out weather or not DFSORT or maybe FILAID can convert XML files to a more traditional formattet dataset that I then can use as input in my cobol-program!

If any of you know anything in that direction, please let me know!
Thanks again for all your responses!!!

Regards!  

RE: Cobol XML Parse from seq.fileFiles

mole

When I asked what type of data you are processing is to see if there would be other means of doing it.

If the xml data is always the same type of data on each file, e.g. number of XML ELEMENTS are always the same and always of the same type, even if there are different "record types" (to use a COBOL terminology), then its feasible to do it.

Also if you are using DB2 v8 or greater, and again depending on the type of information on the xml file, it might be possible for you to use DB2 to do the parsing instead, and pass the info back to you on DB2 table format.

if you can supply the XML Schema (if its not confidencial) then I(we) might be able to give you some more pointers.
Without it its a bit harder, as not XML files are not always REAL XML files, even if they look like it (and i speak based on real experience with badly designed XML files from customers)

Regards

Frederico Fonseca
SysSoft Integrated Ltd
www.syssoft-int.com

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

RE: Cobol XML Parse from seq.fileFiles

Mole,
the XML PARSE statement on the mainframe is used to take one long chunk of XML and using the PROCESSING PROCEDURE XXX-PARSE option, performs another section (XXX-PARSE) to obtain the value of the XML tagged fields and place them into variables in your program.

What (I think) you are describing is a sequential input file that contains lines of XML data. If this is the case, you could read each line of the file and run a XML PARSE statement against it and obtain the data you require. Alternative, you could unstring each line of the file using '<' or '>' in order to get your data out.

I've got an example of the PARSE statement on the mainframe if it would be of any help.

Hope this helps.

Marc

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close