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
 
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 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 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
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

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