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
 

 

Substring Search option does not work

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Substring Search option does not work
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: 8593
Location: Back in jolly old England

PostPosted: Mon Mar 16, 2009 8:49 pm    Post subject:
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    Post subject: Reply to: Substring Search option does not work
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

Site Director


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

PostPosted: Mon Mar 16, 2009 9:32 pm    Post subject:
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    Post subject: Reply to: Substring Search option does not work
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    Post subject: Reply to: Substring Search option does not work
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts Compiler option for override the exte... muralikrishnan_new COBOL Programming 9 Fri Jul 08, 2016 12:09 pm
No new posts Query using SUBSTRING on a column of ... sasanka DB2 5 Mon Jul 04, 2016 1:01 pm
No new posts Search a Load Module sreekanth1984 TSO/ISPF 8 Tue Jun 07, 2016 8:45 pm


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