Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 
XML file parsing problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ibmbansal08

New User


Joined: 31 Jul 2012
Posts: 6
Location: India

PostPosted: Fri Aug 03, 2012 10:53 am    Post subject: XML file parsing problem
Reply with quote

Hi,
I have a requirement for which i am looking for the solution.

"Reqt is to create a DFSORT jcl which read the xml data and creates a PS (sequential file)".
It is supposed to read the content between start and end tags of
Code:
<country>,<onshore>,<startdate>,<enddate>,<offeringname>,<variantname>,<costvalue>,<costtype>,<pricetype>
and write in the PS file.

Output PS file will look like :
Code:
CN  true  2010-10-22 2015-12-31 9076  FUP   1001 USD  TMC PUR

XML file is like:
Code:
"<?xml version=""1.0"" encoding=""UTF-8"" ?>
2 <wwprttxn type=""cost"" id=""99999999""
3         xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""
4         xsi:noNamespaceSchemaLocation=""cost.xsd"">
5         <!-- 
6                 Estimated Cost elements with price point
7     -->


10         <!--
11                 ZIPS Total Manufacturing Cost for China, on a Feature Upgrade Offering
12         -->
13         <cost type=""I"" xsi:type=""costElementType"">
14                 <country>CN</country>
15                 <onshore>true</onshore>
16                 <startdate>2010-10-22</startdate>
17                 <enddate>2015-12-31</enddate>
18                 <offeringname>9076</offeringname>
19                 <varianttype>FUP</varianttype>
20                 <variantname>1001_1002</variantname>
21                 <costvalue uom=""USD"">130.23</costvalue>
22                 <costtype>TMC</costtype>
23                 <pricetype>PUR</pricetype>
24         </cost>"


Please suggest the solutions of this reqt and share the complete DFSORT jcl with me.

Thanks,
Nimish

Code'd
Back to top
View user's profile Send private message

knickraj
Warnings : 1

New User


Joined: 11 Jun 2007
Posts: 50
Location: Euro

PostPosted: Fri Aug 03, 2012 12:59 pm    Post subject:
Reply with quote

you may try something like this..

use when group begin ,end to select records, then use a parse.

Code:
INREC IFTHEN=(WHEN=GROUP,                               
BEGIN=(?,?,CH,EQ,C'<COUNTRY>'),                         
END=(?,?,CH,EQ,C'<PRICETYPE>'),                         
PUSH=(81:ID=1))                                         
OUTFIL PARSE=(%00=(STARTAFT=C'>',ENDBEFR=C'<',FIXLEN=?)
INCLUDE=(81,1,CH,NE,C' '),
Back to top
View user's profile Send private message
ibmbansal08

New User


Joined: 31 Jul 2012
Posts: 6
Location: India

PostPosted: Fri Aug 03, 2012 2:49 pm    Post subject: Reply to: XML file parsing problem
Reply with quote

Hi,

Can you provide me the full JCL.I will change the input file accordingly.

Also provide me the result of this one.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1512
Location: Chennai

PostPosted: Fri Aug 03, 2012 3:04 pm    Post subject:
Reply with quote

Hello,
Asking for a full code is same as asking someone else to do your job for you with no pay of course.
Many of us here like to help people who tried something out and stuck at some point. "give me full code" repels help.

Show us what you have tried and if you are stuck at some point, we will be ready to help.
Quote:
Employer:IBM
Brace yourself
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Fri Aug 03, 2012 4:58 pm    Post subject:
Reply with quote

it seems as if most of he Thread Starters,
especially those who want us to do all the work,
work for consultant firms (like ibm).

it seems that members who work for a company
that is not in the business of charging others to do their work
have fewer requirements and are less demanding.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts editting the file by inserting zeros ... pramodrsingh DFSORT/ICETOOL 9 Mon Aug 21, 2017 5:58 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us