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

Substring Search option does not work


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Mon Mar 16, 2009 8:31 pm
Reply with quote

Hi,

I am searching an input file (LRECL=1092, RECFM=FB) using the SS option of SYNCSORT but not getting the output though the input file has got the values that should be written to output icon_exclaim.gif

Input:
Code:

1Y1SG 1Y1SG 1Y1SR 2Y1SR OY1ST TY1SG PY1ST JY1RS RY130 OY1ST
1Y1SG 1Y1SB 1Y1SR 2Y1SR OY1SB TY1SG PY1SB JY1RS RY130 OY1SB
1Y1SG 1Y1SO 1Y1SR 2Y1SX OY1SX TY1SX PY1SQ JY1RS RY130 OY1SY
1Y1SV 1Y1SN 1Y1SZ 2Y1SV OY1SN TY1SZ PY1SV JY1R1 RY131 OY1SZ


If I used below SYSIN card then I get expected result:
Code:

OPTION COPY
INCLUDE COND=(1,1092,SS,EQ,C'1ST')


Expected Result:
Code:

1Y1SG 1Y1SG 1Y1SR 2Y1SR OY1ST TY1SG PY1ST JY1RS RY130 OY1ST


But, If I used below SYSIN I am NOT getting the result:
Code:

OPTION COPY
INCLUDE COND=(1,1092,SS,EQ,C'1ST,1SX,1SB')


Expected Result:
Code:

1Y1SG 1Y1SG 1Y1SR 2Y1SR OY1ST TY1SG PY1ST JY1RS RY130 OY1ST
1Y1SG 1Y1SB 1Y1SR 2Y1SR OY1SB TY1SG PY1SB JY1RS RY130 OY1SB
1Y1SG 1Y1SO 1Y1SR 2Y1SX OY1SX TY1SX PY1SQ JY1RS RY130 OY1SY


Would you please help.

Thanks.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Mar 16, 2009 8:49 pm
Reply with quote

You need to code the OR parameter and search for each string individually.

Your code is looking for a string that consists of 1ST,1SX,1SB which is not there, so in fact, you are getting the expected results.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Mon Mar 16, 2009 9:21 pm
Reply with quote

I thought if I give it like that it assumes OR condition but not AND. Please correct me if I am wrong.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Mar 16, 2009 9:32 pm
Reply with quote

Hello,

Quote:
I thought if I give it like that it assumes OR condition but not AND. Please correct me if I am wrong.
Yes, this is incorrect. It is not a matter of AND or OR. Your code is looking for a string of '1ST,1SX,1SB'

You happened to pick code that had acceptable syntax, but had nothing to do with what you want to accomplish.
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Tue Mar 17, 2009 2:20 pm
Reply with quote

Hi,

U can use this

Code:

INCLUDE COND=(1,1092,SS,EQ,L(C'1ST',C'1SX',C'1SB'))


or

Code:

INCLUDE COND=(1,1092,SS,EQ,C'1ST',OR,
  1,1092,SS,EQ,C'1SX',OR,
  1,1092,SS,EQ,C'1SB')


Regards
R KARTHIK
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Mar 17, 2009 3:08 pm
Reply with quote

Thanks R KARTHIK. Yes. I used the 2nd method because we are still at v1.2.3 at our shop icon_sad.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
Search our Forums:

Back to Top