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 INREC PARSING and dictionary items migusd SYNCSORT 6 Fri Jun 02, 2017 8:02 pm
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Group elements using ICETOOL Learncoholic DFSORT/ICETOOL 2 Fri Apr 14, 2017 11:01 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


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