View previous topic :: View next topic
|
Author |
Message |
vimalravi83
New User
Joined: 28 Feb 2010 Posts: 21 Location: Bloomington, IL
|
|
|
|
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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Have you tried the "INREC BUILD=(1,80,SQZ=(SHIFT=LEFT))" found in the topic OMIT Spaces? |
|
Back to top |
|
|
vimalravi83
New User
Joined: 28 Feb 2010 Posts: 21 Location: Bloomington, IL
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
vimalravi83
New User
Joined: 28 Feb 2010 Posts: 21 Location: Bloomington, IL
|
|
|
|
Great !!! That worked. Thanks a lot Frank and CICS guy! |
|
Back to top |
|
|
|