IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Binary field in INCLUDE COND


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
krishnapriyavr

New User


Joined: 21 Apr 2009
Posts: 5
Location: india

PostPosted: Sat Aug 14, 2010 4:38 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat Aug 14, 2010 5:09 pm
Reply with quote

FB or VB would be my first question.
Back to top
View user's profile Send private message
krishnapriyavr

New User


Joined: 21 Apr 2009
Posts: 5
Location: india

PostPosted: Sat Aug 14, 2010 5:22 pm
Reply with quote

Its FB only
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Aug 14, 2010 5:31 pm
Reply with quote

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
View user's profile Send private message
krishnapriyavr

New User


Joined: 21 Apr 2009
Posts: 5
Location: india

PostPosted: Sat Aug 14, 2010 5:40 pm
Reply with quote

Its S9(4) COMP Field in COBOL
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Sat Aug 14, 2010 8:01 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Aug 14, 2010 11:40 pm
Reply with quote

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
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Sun Aug 15, 2010 12:03 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Aug 15, 2010 1:23 am
Reply with quote

Yup, i understood what you meant, but new people might not . . .

Thanks for the followup icon_smile.gif

d
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Aug 16, 2010 10:37 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts S0C7 - Field getting overlayed COBOL Programming 2
Search our Forums:

Back to Top