Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us