View previous topic :: View next topic
|
Author |
Message |
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
Hi,
Could anyone please help me with the following requirement.
I've a input file with a field as 'Name' of 45 characters length.. For Example following is my input.
LOPEZ, MODESTO P.
SEDGWICK, TOM M
KENNEDY, KATHERINE M.
EIN, MARK D.
MCCOY, CHARLES H.
GRAY, RICHARD F.
THE ERICA LEIGH HOPKINS TRUST
I want to remove the SPACES and the Special characters inbetween these names. Here the special characters are ,(dot) and .(comma)
The output i need is like without spaces, (.dot) and ,(comma) in the name.
LOPEZMODESTOP
SEDGWICKTOMM
KENNEDYKATHERINEM
EINMARKD
MCCOYCHARLESH
GRAYRICHARDF
THEERICALEIGHHOPKINSTRUST
Can this be done using sort??
Thanks,
Dharani |
|
Back to top |
|
|
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:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/45)
//SORTOUT DD DSN=... output file (FB/45)
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,45,SQZ=(SHIFT=LEFT,PREBLANK=C'.,'))
/*
|
|
|
Back to top |
|
|
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
Frank, Thanks a lot for the help that comes from you as always
Thanks,
Dharani |
|
Back to top |
|
|
r.ravikumar
New User
Joined: 05 Jan 2007 Posts: 18 Location: chennai
|
|
|
|
HI Frank,
Can you explain the INREC BUILD statement in the above JCL. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Can you explain the INREC BUILD statement in the above JCL. |
Code: |
INREC BUILD=(1,45,SQZ=(SHIFT=LEFT,PREBLANK=C'.,'))
|
It uses DFSORT's SQZ function to squeeze out blanks, dots and commas.
1,45 specifies the field to be squeezed (1-45).
SQZ removes blanks.
PREBLANK=C'.,' indicates that all dot and comma characters are to be treated as blanks.
SHIFT=LEFT indicates that the field is to be squeezed to the left. Blank characters and PREBLANK characters are removed and the remaining bytes are moved to the left.
For complete information on DFSORT's SQZ function, see:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|