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
 

 

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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm


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