On Jun 15, 6:19 am, oktg wrote:
> I wonder if anybody could help me out with following question:
>
> i want to use DFSORT/ICETOOL to convert a flat file (eg FB,80) having
> the following layout:
>
> ----+----1----+----2----+----3
> ******************************
> FL641 10JAN1993 VOL JFK
> FL642 11JAN1993 JFK VOL
> ******************************
>
> col  1-5: flightnumber
> col  7-15: flightdate
> col 17-19: departure station
> col 21-23: arrival station
>
> to an XML file having the following layout (eg, VB,255)
>
> <ROW>
> <FLIGHTNR>FL641</FLIGHTNR>
> <FLTDATE>10JAN1993</FLTDATE>
> <DEPSTAT>VOL</DEPSTAT>
> <ARRSTAT>JFK</ARRSTAT>
> </ROW>
> <ROW>
> <FLIGHTNR>FL642</FLIGHTNR>
> <FLTDATE>11JAN1993</FLTDATE>
> <DEPSTAT>JFK</DEPSTAT>
> <ARRSTAT>VOL</ARRSTAT>
> </ROW>
>
> so i need to map 1 input record to n output records
>
> Many thanks in advance

Here's a DFSORT job that will do what you asked for:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/23)
//SORTOUT DD LRECL=255,DSN=...  output file (VB/255)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FTOV,BUILD=(C'<ROW>',/,
   C'<FLIGHTNR>',1,5,C'</FLIGHTNR>',/,
   C'<FLTDATE>',7,9,C'</FLTDATE>',/,
   C'<DEPSTAT>',17,3,C'</DEPSTAT>',/,
   C'<ARRSTAT>',21,3,C'</ARRSTAT>',/,
   C'</ROW>')
/*

Frank Yaeger - DFSORT Development Team (IBM) - [EMAIL PROTECTED]
Specialties: PARSE, JFY, SQZ, ICETOOL, IFTHEN, OVERLAY, Symbols, Migration

 => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to