Binary fields in Sort



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Binary fields in Sort

Postby kjd2121 » Fri Aug 15, 2014 12:15 am

Hi,

I am new to the forum and have a Sort question.

My input file is VB and the field I need to query is in col 30-31 as follows -
3-
F-
3-
00
0A
..
02
04
..
00
0A

I am trying to split the file based on the value in columns 30-31 - either a value of 10 or 36.

The COBOL field definition is RECORD-TYPE PIC S9(04) COMP.

I believe this is a BI field for Sort.

Here is my code:

SORT FIELDS=COPY

OUTFIL FILES=01,
INCLUDE=(34,2,BI,EQ,X'00001010')

OUTFIL FILES=02,
INCLUDE=(34,2,BI,EQ,X'00100100')

This does not work. I have tried other variations and have failed.

How can I code this to get two output files - One with records that have a 10 in byte 30 and one with records that have a 36 in byte 30?

Thank you.
kjd2121
 
Posts: 2
Joined: Thu Aug 14, 2014 11:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Binary fields in Sort

Postby BillyBoyo » Fri Aug 15, 2014 1:58 am

Your binary constant is only one byte long, and you are comparing it to two bytes.

If you want the value that is in byte 35 only, irrespective of what is in byte 34 (the first byte of the COBOL definition) then use 31,1,CH with the X'....', or 35,1,Bi,EQ,10 and 35,1,BI.EQ,36. If you need the value in the two-byte field, 34,2,BI,EQ,10 and 34,2,BI,EQ,36.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Binary fields in Sort

Postby kjd2121 » Fri Aug 15, 2014 2:08 am

Billy,

Seems that was one of the combinations I didn't try. It worked like a miracle :)

Thank you.
kjd2121
 
Posts: 2
Joined: Thu Aug 14, 2014 11:58 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post