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

How can I search for HIGH VALUES with SORT ?


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

New User


Joined: 27 Sep 2008
Posts: 70

PostPosted: Thu Oct 23, 2008 4:28 pm
Reply with quote

Hi,

I need to search for HIGH VALUES in my input file, location of the HIGH VALUES is in the first 50 bytes. How can I do this work a Sort card ?
I am currently using the following :

SORT FIELDS=COPY
INCLUDE COND=(1,50,CH,EQ,50X'FF')

But its not working ...
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: Thu Oct 23, 2008 9:22 pm
Reply with quote

Code:

  INCLUDE COND=(1,50,CH,EQ,50X'FF')


50X'FF' is NOT valid syntax in the INCLUDE statement. If you want to check for 50 X'FF' bytes, you need to use the correct syntax as follows. Substitute b for each leading blank. The * must be in column 72.

Code:

bbSORT FIELDS=COPY
bbINCLUDE COND=(1,50,CH,EQ,
bX'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF*
bFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF')
Back to top
View user's profile Send private message
JayC

New User


Joined: 27 Sep 2008
Posts: 70

PostPosted: Fri Oct 24, 2008 1:55 pm
Reply with quote

Oh, So i need to put in 'FF' x 50 times in my sort card ? I mean, isn't there a shorter easier way ?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Oct 24, 2008 9:15 pm
Reply with quote

Jayc,

You can define a symbol like this for 10 bytes and use that to include/omit the records

Code:

//SYMNAMES DD *               
HIGHVAL,X'FFFFFFFFFFFFFFFFFFFF'


Code:

//SYSIN    DD *                       
  SORT FIELDS=COPY                   
  INCLUDE COND=(01,10,CH,EQ,HIGHVAL,AND,
                11,10,CH,EQ,HIGHVAL,AND,
                21,10,CH,EQ,HIGHVAL,AND,
                31,10,CH,EQ,HIGHVAL,AND,
                41,10,CH,EQ,HIGHVAL)     

/*
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: Fri Oct 24, 2008 9:38 pm
Reply with quote

Quote:
Oh, So i need to put in 'FF' x 50 times in my sort card ? I mean, isn't there a shorter easier way ?


Gee, editors are pretty good at duplicating things. It took me about 2 minutes to set up those control statements.

However, if that's too much for you, another way (though less efficient) would be to use 50X'FF' to create a temporary constant at the end of each record and compare to that. For the example below, I'm assuming your input file has RECFM=FB and LRECL=80.

Code:

//SYSIN DD *
   OPTION COPY
   INREC OVERLAY=(81:50X'FF')
   OUTFIL INCLUDE=(1,50,CH,EQ,81,50,CH),BUILD=(1,80)
Back to top
View user's profile Send private message
samuel_Inba

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Thu Oct 30, 2008 1:42 pm
Reply with quote

u can just use this control card to include records with high values in first 50 positions....


OPTION COPY
OUTFIL FNAMES=O1,INCLUDE=(1,50,BI,EQ,X'FF')

this will search the entire 50 locations for high values...



Regards,
Sam.
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: Thu Oct 30, 2008 9:00 pm
Reply with quote

Sam,

Quote:

OPTION COPY
OUTFIL FNAMES=O1,INCLUDE=(1,50,BI,EQ,X'FF')

this will search the entire 50 locations for high values...


No, it won't! Hex constants are padded on the right with binary zeros (X'00') to the length of the field. Your X'FF' constant will actually be handled as a X'FF00...00' constant, not a X'FFFF...FF' constant.

Please don't post "guesses" or untested "solutions" in this Forum. We have two DFSORT developers (Kolusu and myself) answering questions in this Forum, so we don't really need anyone else's "help".
Back to top
View user's profile Send private message
samuel_Inba

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Fri Oct 31, 2008 10:20 am
Reply with quote

I am sorry ... I tested it for X'00' and i thought it wud work the same way for X'FF'. I ll make sure to test all possibilities before posting.

Thanks,
Sam
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top