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

XML file parsing problem


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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     -->
8 
9 
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
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
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: 1753
Location: Tirupur, India

PostPosted: Fri Aug 03, 2012 3:04 pm
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: 6965
Location: porcelain throne

PostPosted: Fri Aug 03, 2012 4:58 pm
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 All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts IGYPG3178-I when compiling a pgm read... COBOL Programming 6
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
No new posts To Sort detail records in a file with... SYNCSORT 5
No new posts To Populate Trailer cnt in the file w... SYNCSORT 1
Search our Forums:


Back to Top