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

Parsing in ICETOOL.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vaibhavjadhav

New User


Joined: 27 Jul 2007
Posts: 33
Location: mumbai

PostPosted: Wed Jun 29, 2011 10:51 pm
Reply with quote

Hi,

Could you please help me in getting the desired output through ICETOOL.

Explanation:
The input is a flat file with space between each field and want the output to be written as shown below. In the output the DEPT and NAME should be written in "(double inverted commas).

The length of each field DEPT, NAME and SAL can be assumed as 10 bytes each. The DEPT and NAME are character fields X(10) and SAL is numeric field 9(10). Input files can have RECFM=FB and LRECL=80,

Please refer to the below output structure for more clarity.

Thanks in advance

Code:

Input:
AB12 ALFRED H 1100
PQRS123 BILL GATES 2222000
XY1 NADAL R  330

Output:
"AB12","ALFRED H",1100
"PQRS123","BILL GATES",2222000
"XY1","NADAL R",330


Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jun 29, 2011 11:24 pm
Reply with quote

Here's a DFSORT job that will do what you asked for (you can, of course, convert this to a DFSORT/ICETOOL job with a COPY operator if you want to for some reason):

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN DD *
  OPTION COPY
  INREC IFOUTLEN=80,
    IFTHEN=(WHEN=INIT,
      PARSE=(%01=(ENDBEFR=C' ',FIXLEN=15),
             %02=(ENDBEFR=C' ',FIXLEN=15),
             %03=(ENDBEFR=C' ',FIXLEN=15),
             %04=(FIXLEN=10)),
      BUILD=(%01,%02,%03,%04)),
    IFTHEN=(WHEN=INIT,
      BUILD=(1,15,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'),
             16,30,SQZ=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',MID=C' '),
             46,15)),
    IFTHEN=(WHEN=INIT,
      BUILD=(1,60,SQZ=(SHIFT=LEFT,MID=C',',PAIR=QUOTE)))
/*
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Parsing Large JSON file using COBOL COBOL Programming 4
Search our Forums:

Back to Top