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

Sort by bits SORT FIELDS=(133.1,.1,BI,A)


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

New User


Joined: 05 Dec 2007
Posts: 57
Location: chennai

PostPosted: Mon Mar 24, 2008 5:14 pm
Reply with quote

Code:

//SYSIN    DD  *             
  SORT FIELDS=(133.1,.1,BI,A)
  OUTREC FIELDS=(1:133,1)         
/*                     


which byte it will take to sort ?

Code:

3----+----4----+----5--
***********************
005              1DO   
FFF10040000000044FCD444
00500100000000000146000
-----------------------
718Ø             1DO   
FFF80040000000044FCD444
71800000000000000146000
-----------------------
818              1DO   
FFF00040000000044FCD444
81800000000000000146000
-----------------------
268              1OO   
FFF00040000000044FDD444
26810000000000000166000
-----------------------   


i have given input file for the sort ( starting form 130th column).
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 Mar 24, 2008 8:36 pm
Reply with quote

Quote:
which byte it will take to sort ?


arivazhagan.k

133.1,.1 specifies the second bit in the byte at position 133.

So any byte in position 133 with:

B'.0......'

will sort before any byte in position 133 with:

B'.1......'

where . is a 0 or a 1. Only the second bit matters.
Back to top
View user's profile Send private message
arivazhagan_k

New User


Joined: 05 Dec 2007
Posts: 57
Location: chennai

PostPosted: Mon Mar 24, 2008 9:16 pm
Reply with quote

Code:
 
10
00
--
Ø
80
00
--
 
00
00
--
 
00
10
--
Ø
80
00
--
Ø
80
00
--
Ø
80
00
--
Ø
80
00
--
Ø
80
00


As you said it should come like 0,1....
But output came like above .why?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Mar 24, 2008 9:26 pm
Reply with quote

x'10' = b'00010000'
x'80' = b'10000000'
x'01' = b'00000001'

All of these have '0' in the second bit.

Maybe you should be sorting on 133,1,BI,A for the whole byte rather then just on one bit.
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 Mar 24, 2008 9:32 pm
Reply with quote

The only digit that matters here is the first one (e.g 8 in X'8000') since it contains the second bit:

0 = B'0000'
1 = B'0001'
8 = B'1000'

These all have 0 in the second bit so they all sort equally. (4 = B'0100' has a 1 in the second bit so it would sort after these others.)

If you have EQUALS in effect, the output records will be in the same order as the input records. If you have NOEQUALS in effect, the output records can be in any order.

You don't seem to understand what your SORT statement does. Maybe it's not the SORT statement you actually need. Perhaps you should tell me what you're trying to do so I can tell you how to do it.
Back to top
View user's profile Send private message
arivazhagan_k

New User


Joined: 05 Dec 2007
Posts: 57
Location: chennai

PostPosted: Mon Mar 24, 2008 9:49 pm
Reply with quote

Frank Yaeger,
Craq,

Thanks for both of you .
Back to top
View user's profile Send private message
arivazhagan_k

New User


Joined: 05 Dec 2007
Posts: 57
Location: chennai

PostPosted: Mon Mar 24, 2008 9:53 pm
Reply with quote

Before you post that ans i tried with same sample data "4 = B'0100' ".
i am wondering.
Now i got it .Thanks for your valuable response.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
Search our Forums:

Back to Top