MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

nested searching in a string

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
blitz
Beginner


Joined: 24 Dec 2002
Posts: 28
Topics: 4

PostPosted: Mon Jul 14, 2003 11:27 pm    Post subject: nested searching in a string Reply with quote

hi,

My input can be any of the following,
Code:

FD=23,43 COM=34,01 HTR=93 ... or
RTY=94 COM=05 HTR=93 MP=26,41 ... or
COM=04,26,12 HTR=92 SUR=12,71 .. etc


I need to find out if 'COM' has symbol '03' or '04' in it ? Pls note that symbol (numbers after '=') will always be 2 bytes.
We use cobol OS 390 in our shop.

thanks
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Tue Jul 15, 2003 2:27 am    Post subject: Reply with quote

Blitz,
Have you considered using SORT? In DFSORT, you can use SS option for INCLUDE or OMIT. That is,
Code:

//SYSIN    DD *
 OPTION COPY
 INCLUDE COND=(1,lrecl,SS,EQ,C'COM=03',OR,
                           1,lrecl,SS,EQ,C'COM=04')
/*



Note that, different PTF levels of DFSORT will support different values of lrecl. So, if the LRECL is very large, you will have to split each INCLUDE condition.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
blitz
Beginner


Joined: 24 Dec 2002
Posts: 28
Topics: 4

PostPosted: Tue Jul 15, 2003 6:06 am    Post subject: Reply with quote

Cogito, thanks for the sort solution but i had to do that in a cobol program. anyway, i used a few unstring and inspect clauses to do the trick.

thanks
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Tue Jul 15, 2003 6:12 am    Post subject: Reply with quote

blitz,
You are welcome.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Jul 15, 2003 10:06 am    Post subject: Reply with quote

Cogito said
Quote:
Note that, different PTF levels of DFSORT will support different values of lrecl. So, if the LRECL is very large, you will have to split each INCLUDE condition.


To clarify, if you have DFSORT R14 PTF UQ90053 (Feb, 2003) installed, the maximum length for an SS field used with INCLUDE and OMIT is 32752. If you don't have UQ90053 installed, the maximum length is 256.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Tue Jul 15, 2003 11:11 pm    Post subject: Reply with quote

Hi Blitz,

You might try this (untested):

MOVE ZEROS TO POS

INSPECT MY-STRING TALLYING POS
FOR CHARACTERS BEFORE INITIAL 'COM='

EVALUATE MY-STRING(POS + 4:2)
WHEN '03'
yada yada
WHEN '04'
yada yada
END-EVALUATE
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group