vaibhavjadhav
New User
Joined: 27 Jul 2007 Posts: 33 Location: mumbai
|
|
|
|
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
|
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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)))
/*
|
|
|