Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Removing unwanted characters in a field using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
nagarajan.dharani

New User


Joined: 27 Dec 2006
Posts: 36
Location: Chennai

PostPosted: Fri Feb 29, 2008 7:26 pm    Post subject: Removing unwanted characters in a field using SORT
Reply with quote

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
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


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

PostPosted: Fri Feb 29, 2008 10:07 pm    Post subject:
Reply with quote

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
View user's profile Send private message
nagarajan.dharani

New User


Joined: 27 Dec 2006
Posts: 36
Location: Chennai

PostPosted: Mon Mar 03, 2008 4:14 pm    Post subject:
Reply with quote

Frank, Thanks a lot for the help that comes from you as always
icon_biggrin.gif

Thanks,
Dharani
Back to top
View user's profile Send private message
r.ravikumar

New User


Joined: 05 Jan 2007
Posts: 18
Location: chennai

PostPosted: Mon Mar 03, 2008 5:21 pm    Post subject: Re: Removing unwanted characters in a field using SORT
Reply with quote

HI Frank,

Can you explain the INREC BUILD statement in the above JCL.
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: Mon Mar 03, 2008 10:28 pm    Post subject:
Reply with quote

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:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us