View previous topic :: View next topic
Author
Message
ramsri Active User Joined: 18 Oct 2008Posts: 380 Location: India
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
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
expat Global Moderator Joined: 14 Mar 2007Posts: 8797 Location: Welsh Wales
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
ramsri Active User Joined: 18 Oct 2008Posts: 380 Location: India
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
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
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
karthikr44 Active User Joined: 25 Aug 2007Posts: 235 Location: Chennai
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
ramsri Active User Joined: 18 Oct 2008Posts: 380 Location: India
Thanks R KARTHIK. Yes. I used the 2nd method because we are still at v1.2.3 at our shop
Back to top
Please enable JavaScript!