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
 

 

Parsing in ICETOOL.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Parsing in ICETOOL.
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 Moderator


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

PostPosted: Wed Jun 29, 2011 11:24 pm    Post subject:
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    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 How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Icetool or Joinkeys example to compar... ishant chauhan DFSORT/ICETOOL 21 Sat Aug 20, 2016 2:40 am
No new posts ICETOOL higher option Anshul Das DFSORT/ICETOOL 14 Thu Apr 14, 2016 8:00 am
No new posts Parsing and Listing a Subset of Recor... Charles Wolters IBM Tools 3 Fri Feb 05, 2016 10:39 pm


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