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 extract records for the String having space in it

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
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    Post subject: How to extract records for the String having space in it
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Mon Oct 13, 2014 9:14 pm    Post subject: Reply to: How to extract records for the String having space
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: 1219
Location: Israel

PostPosted: Mon Oct 13, 2014 9:38 pm    Post subject:
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    Post subject:
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    Post subject: Re: Reply to: How to extract records for the String having s
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Mon Oct 13, 2014 10:02 pm    Post subject: Reply to: How to extract records for the String having space
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    Post subject: Re: Reply to: How to extract records for the String having s
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: 1219
Location: Israel

PostPosted: Tue Oct 14, 2014 5:51 pm    Post subject:
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: 268
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Oct 15, 2014 10:48 am    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Wed Oct 15, 2014 9:03 pm    Post subject:
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.
http://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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am


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