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
 

 

How to remove spaces in a string using SORT?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
vimalravi83

New User


Joined: 28 Feb 2010
Posts: 21
Location: Bloomington, IL

PostPosted: Fri Mar 26, 2010 7:33 pm    Post subject: How to remove spaces in a string using SORT?
Reply with quote

Hi,
I have a string which can contain spaces in between. How can I remove those spaces and trim the string to it's left. Once it is done, if there are any lowercase charaters, it should be converted into uppercase. Is there anyway can we do this using SORT function? Spaces can come anywhere in input string, not in a fixed position. Length of input string is 25 chars.

For eg;
Input String;
----+----1----+----
abC16 98KJ Mn


Output String;
----+----1----+----
ABC1698KJMN
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Mar 26, 2010 7:43 pm    Post subject:
Reply with quote

Quote:
remove those spaces and trim the string to it's left
And leave the length at the original 25 characters?

Dfsort or Syncsort?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Mar 26, 2010 7:49 pm    Post subject:
Reply with quote

Have you tried the "INREC BUILD=(1,80,SQZ=(SHIFT=LEFT))" found in the topic OMIT Spaces?
Back to top
View user's profile Send private message
vimalravi83

New User


Joined: 28 Feb 2010
Posts: 21
Location: Bloomington, IL

PostPosted: Fri Mar 26, 2010 8:24 pm    Post subject:
Reply with quote

CICS Guy wrote:
Have you tried the "INREC BUILD=(1,80,SQZ=(SHIFT=LEFT))" found in the topic OMIT Spaces?
.

Let me try SQUEEZE option. I think that should work for me. DFSORT or SYNCSORT ..both are fine with me.
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 Mar 26, 2010 9:17 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN DD *
   OPTION COPY
   INREC OVERLAY=(1:1,25,SQZ=(SHIFT=LEFT),
    1:1,25,TRAN=LTOU)
/*
Back to top
View user's profile Send private message
vimalravi83

New User


Joined: 28 Feb 2010
Posts: 21
Location: Bloomington, IL

PostPosted: Sun Mar 28, 2010 11:16 pm    Post subject:
Reply with quote

Great !!! That worked. Thanks a lot Frank and CICS guy! icon_lol.gif
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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