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 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 SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm


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