IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to extract records for the String having space in it


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
srinivasulu.p

New User


Joined: 10 Jul 2012
Posts: 22
Location: india

PostPosted: Mon Oct 13, 2014 9:06 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Oct 13, 2014 9:14 pm
Reply with quote

Code:
 INCLUDE COND=(start,length,SS,EQ,C' ')
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Oct 13, 2014 9:38 pm
Reply with quote

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
View user's profile Send private message
srinivasulu.p

New User


Joined: 10 Jul 2012
Posts: 22
Location: india

PostPosted: Mon Oct 13, 2014 9:43 pm
Reply with quote

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
View user's profile Send private message
srinivasulu.p

New User


Joined: 10 Jul 2012
Posts: 22
Location: india

PostPosted: Mon Oct 13, 2014 9:54 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Oct 13, 2014 10:02 pm
Reply with quote

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
View user's profile Send private message
srinivasulu.p

New User


Joined: 10 Jul 2012
Posts: 22
Location: india

PostPosted: Mon Oct 13, 2014 10:09 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Oct 14, 2014 5:51 pm
Reply with quote

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

Quote:
Eg: abcde abcde


2) SUR_NAME has complete spaces

11 characters don't make a good example.
Quote:
and I quote myself!
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Oct 15, 2014 10:48 am
Reply with quote

Quoteception: Quote within a quote within a quote icon_smile.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Oct 15, 2014 9:03 pm
Reply with quote

I think you just overlooked latest trending topic on this forum.. So this gives you an idea as to what Bill is saying.
ibmmainframes.com/viewtopic.php?t=63350&highlight=
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top