Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How can I search for HIGH VALUES with SORT ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How can I search for HIGH VALUES with SORT ?
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 Moderator


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

PostPosted: Thu Oct 23, 2008 9:22 pm    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Oct 24, 2008 9:38 pm    Post subject:
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    Post subject: Reply to: How can I search for HIGH VALUES with SORT ?
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 Moderator


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

PostPosted: Thu Oct 30, 2008 9:00 pm    Post subject:
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    Post subject: Reply to: How can I search for HIGH VALUES with SORT ?
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ESQA overflow - high ECSA utilization vasanthz All Other Mainframe Topics 1 Thu Dec 29, 2016 7:06 am
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us