and in my input file this filds has millions of records , I want to pick up one which has the value : 520565. And I have written the following sort to get the data but some how its not working , could you please tell me that what will be the correct syntex for this :
171,6,PD,EQ,'520565')
--171-Starting postion
--6-total length of the field.
--PD -because its a COMP-3.
Note : I tried couple of options by giving
171,6,PD,EQ,X'520565') and 171,6,PD,EQ,P'520565') AND BY giving leading zero in 520565 to make it look like file value, but no success.
SYNCSORT FOR Z/OS 1.3.2.1R
2007 SYNC
z/OS 1.11.0
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 434F0, MODEL 2094 605 LIC
SYSIN :
=============================================
SORT FIELDS=COPY
INCLUDE COND=((115,18,CH,EQ,C'77901TA0 A000 ',OR, <<PART NUMBER
115,18,CH,EQ,C'77901TA0 A100 '),AND, <<PART NUMBER
96,6,CH,EQ,C'210560',AND, <<<SUPP-CD
102,2,CH,EQ,C'01',AND, <<<SUPP-LOC
171,6,PD,EQ,X'520565') <<<ORD-NUMBER
*
WER253A INCLUDE/OMIT FORMATS INCOMPATIBLE
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER253A INCLUDE/OMIT FORMATS INCOMPATIBLE
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
what happened when you tried it without the quotes ?
Gerry
Tired two option based on your comment : both gave MAXCC=0 but no results , I am 100% sure about my starting position and rec-length so what i think is its not understanding the value of ord-number , any idea is there different way to write COMP-3 ??? my value is =
Code:
===========
000255
00506C which is nothing but 520565
==========
Option-1
INCLUDE COND=((115,18,CH,EQ,C'77901TA0 A000 ',OR, <<PART NUMBER
115,18,CH,EQ,C'77901TA0 A000 '),AND, <<PART NUMBER
96,6,CH,EQ,C'210560',AND, <<<SUPP-CD
102,2,CH,EQ,C'01',AND, <<<SUPP-LOC
171,6,PD,EQ,00000520565) <<ORD-NUMBER
option-2
INCLUDE COND=((115,18,CH,EQ,C'77901TA0 A000 ',OR, <<PART NUMBER
115,18,CH,EQ,C'77901TA0 A000 '),AND, <<PART NUMBER
96,6,CH,EQ,C'210560',AND, <<<SUPP-CD
102,2,CH,EQ,C'01',AND, <<<SUPP-LOC
171,6,PD,EQ,520565) <<ORD-NUMBER
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
Hi,
is the file FB or VB ?
Have you tried selecting 1 single field to see if you have the correct starting positions ?
Also 115,18, means you are searching from 115-132, the string you are searching for is only 14 bytes long C'77901TA0 A000 ' so unless 129-132
has spaces in it, you will not select anything.
Either should work, since there are no error messages with them, right?
I suggest you display/browse the input file and 'hex on' and cut&paste the first screen of data and the screen centering on position 171.
Please post the current JCL and the sysouts produced by the run with that JCL and the results that "gave MAXCC=0 but no results".
By the way, just cur &paste and wrap in 'code' rather than 'quote'. And no bolding/underlining/color/font size is needed, we can find the needed info without that stuff........
Have you tried selecting 1 single field to see if you have the correct starting positions ?
Also 115,18, means you are searching from 115-132, the string you are searching for is only 14 bytes long C'77901TA0 A000 ' so unless 129-132
has spaces in it, you will not select anything.
Quote:
Ans:
Ans-1 : This is a FB,
Ans-2 : Yes 115,18 fields is correct , I ran it more than 100 times and after removing my LAST SORT CONDTION and it works fine. But this time finally I thought I should get the clarification from your all on how to use it .
When I remove the last sort condition on comp-3 filed i will get the proper result.
If you see carefully the Also 115,18 : till whatever position i have value i have given that and after that it has space to make it 18 BYTES. So trust me all the other sort conditions are correct the only problem is that COMP-3 SORT FIELD.
Guys it seems it work, as MR. gcicchet, suggested that try without quotes: at that time it gave the MAXCC=0 and when I checked output file , it was having nothing . And I assumed that my input file is having the data , but that was the wrong understanding because I have deleted that input file in my first delete statement.
Just now I again tried the same thing , full input file comp-3 filed as
171,6,PD,EQ,520565) <<<ORD-NUMBER
It worked man,
BILLIONS OF THANKS .
[color=red]special thanks to CICS Guy, gcicchet, William Thompson .[/color]
==============================================
Learning from this post :
Question : If we want to select some COMP-3 filed and give the value on the sort card what is the syntax for the same ?
Ans:
Ex if your comp-3 field has definition PIC S9(10)V USAGE COMP-3. and YOU KNOW THE VALUE IS
000255
00506C
Which is 520565 THEN this is how it should be coded.
171,6,PD,EQ,520565) <<<<<<<<comp-3 field.
WHERE 171- Starting position .
6--- length of PIC S9(10)V USAGE COMP-3
PD—FOR COMP-3 DATA TYPE
EQ- your selection criteria it can be LT,GT,LE, OR ANY OTHER POSSIBLE OPTION.
520565- THIS WAS THE VALUE WHICH I WAS TRYING TO SELECT .
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
My, how wonderful that you have solve your problem, and colorful to boot....grin.....
Quote:
it seems it work, as MR. gcicchet, suggested that try without quotes
Congrats Gerry......
Also should be "Learning from this post":
Quote:
By the way, just cur &paste and wrap in 'code' rather than 'quote'. And no bolding/underlining/color/font size is needed, we can find the needed info without that stuff........