View previous topic :: View next topic
|
Author |
Message |
krishnapriyavr
New User
Joined: 21 Apr 2009 Posts: 5 Location: india
|
|
|
|
Hi,
I need to copy a file to another file and needs to include a condition to omit some values. The value which i need to omit is a Binary field.
In my sort i have given it as
SORT FIELDS=COPY
INCLUDE COND=(61,2,BI,NE,17)
But this sort is not omitting the values from the file at position 61 which is having value 17.
I am getting all the values copied to output file...
Please correct my sort so that it will eliminate the binary values with 17 from the file
Could some one pls help me with this .... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
FB or VB would be my first question. |
|
Back to top |
|
|
krishnapriyavr
New User
Joined: 21 Apr 2009 Posts: 5 Location: india
|
|
|
|
Its FB only |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What is the COBOL picture of this field?
2 digits does not equal a length of 2 in the sort control statement. . . |
|
Back to top |
|
|
krishnapriyavr
New User
Joined: 21 Apr 2009 Posts: 5 Location: india
|
|
|
|
Its S9(4) COMP Field in COBOL |
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
Priya,
I ran a test job with 2 byte binary field having value of 17 and omitted the record correctly.
Just wondering if your intention is to OMIT records why are you using INCLUDE with NOT EQUAL condition? Why couldn't you use OMIT?
Do you have any other INCLUDE condition along with the one mentioned above?
If it is possible, please send us a screenshot of the input file as position 61 with hex on. Also please send us entire SYSOUT if possible.
Thanks, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
please send us a screenshot of the input file as position 61 with hex on |
Please do not post "screenshots" as they introduce clutter and waste space.
Please use copy/paste from the terminal and the "Code" tag which will preserve alignment and have the appearance of a "green screen". |
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
dick scherrer,
I should have been more careful for the choice of my words. By screenshot I mean to ask OP for the input data but I should have just asked for input data in code tags.
Thanks, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Yup, i understood what you meant, but new people might not . . .
Thanks for the followup
d |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Priya,
If it didn't work, then you're misinterpreting things.
A 2-byte BI value of 17 is X'0011'. Is that what you're looking for? Perhaps you think you are testing for C'17'? To do that, you would use CH, not BI.
Consider this DFSORT job:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
61-62 HAS X'0000'=0
61-62 HAS X'0011'=17
61-62 HAS X'0010'=16
61-62 HAS X'F1F7'=C'17' 17
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=OUT1,INCLUDE=(61,2,BI,NE,17)
OUTFIL FNAMES=OUT2,INCLUDE=(61,2,BI,NE,C'17')
|
OUT1 has:
Code: |
61-62 HAS X'0000'=0
61-62 HAS X'0010'=16
61-62 HAS X'F1F7'=C'17' 17
|
OUT2 has:
Code: |
61-62 HAS X'0000'=0
61-62 HAS X'0011'=17
61-62 HAS X'0010'=16
|
If you still can't figure it out, then you can use:
Code: |
OPTION COPY
INREC BUILD=(61,2,HEX)
|
to see the actual values in 61-62 in hex. |
|
Back to top |
|
|
|