View previous topic :: View next topic
|
Author |
Message |
srinivasulu.p
New User
Joined: 10 Jul 2012 Posts: 22 Location: india
|
|
|
|
Quote: |
Hi
I have File having SUR_NAMES .....my requirement is to extract records only sur_name has SPACES or SPACE between SUR_NAME using sort or syncsort
INPUT :
Eg: ABCDE
(SPACE)
SBC CD
A CCCC
OUTPUT : SPACE RECORD
SBC CD
A CCCC
Kindly help me how achieve this using Syncsort or Sort
|
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Code: |
INCLUDE COND=(start,length,SS,EQ,C' ') |
|
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Your requirement is not clear. Neither is your example.
How large is the field ?
Spaces to the left ? in the middle ? to the right ? |
|
Back to top |
|
|
srinivasulu.p
New User
Joined: 10 Jul 2012 Posts: 22 Location: india
|
|
|
|
Marso wrote: |
Your requirement is not clear. Neither is your example.
How large is the field ?
Spaces to the left ? in the middle ? to the right ? |
Quote: |
String max length is 10
1) have to find the string having atleast one space in between SUR_NAME
Eg: abcde abcde
2) SUR_NAME has complete spaces
|
|
|
Back to top |
|
|
srinivasulu.p
New User
Joined: 10 Jul 2012 Posts: 22 Location: india
|
|
|
|
Bill Woodger wrote: |
Code: |
INCLUDE COND=(start,length,SS,EQ,C' ') |
|
Quote: |
Thanks for your response
max SUR_NAME length is 10
i want to write the records to out file where the SUR_NAME has SPACES in mid(in between SUR_NAME)
OR SUR_NAME has SPACE
If i use above INCLUDE COND i am getting the records where the SUR_NAME is not having SPACE in between
EG: if SUR_NAME is (abcdefgh) even though it doesn't have SPACE in between SRTING its writing to file
because SUR_NAME max length is 10 and the string is has length of 8 rest of 2 chars considering as SPACE
MY INPUT FILE
<----------->
1 ABCDEFGHIJ
2 ABCDEFGH
3 ABCD EF
4
DESIRE OUTPUT IS:
3 ABCD EF
4
|
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
OK, you'll need to PARSE with two fields, the first ending at blank, and the second just catching everything to your maximum length.
If the first PARSEd field is blank or if the second is non-blank, then those are the records you want. Mark them, use OUTFIL INCLUDE= and BUILD to get back to the original size. |
|
Back to top |
|
|
srinivasulu.p
New User
Joined: 10 Jul 2012 Posts: 22 Location: india
|
|
|
|
Bill Woodger wrote: |
OK, you'll need to PARSE with two fields, the first ending at blank, and the second just catching everything to your maximum length.
If the first PARSEd field is blank or if the second is non-blank, then those are the records you want. Mark them, use OUTFIL INCLUDE= and BUILD to get back to the original size. |
Quote: |
Thank you so much for your quick response...Yes exactly Bill thats what my requirement.... i am bit confuse with PARSE in sort can you please help me providing a bit sample CODE |
|
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
srinivasulu.p wrote: |
Marso wrote: |
Your requirement is not clear. Neither is your example.
How large is the field ?
Spaces to the left ? in the middle ? to the right ? |
Quote: |
Quote: |
String max length is 10 |
1) have to find the string having atleast one space in between SUR_NAME
2) SUR_NAME has complete spaces
|
11 characters don't make a good example.
Quote: |
and I quote myself! |
|
|
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Quoteception: Quote within a quote within a quote |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
Back to top |
|
|
|