Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Sort by bits SORT FIELDS=(133.1,.1,BI,A)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort by bits SORT FIELDS=(133.1,.1,BI,A)
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 Moderator


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

PostPosted: Mon Mar 24, 2008 8:36 pm    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Mon Mar 24, 2008 9:32 pm    Post subject:
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    Post subject:
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    Post subject:
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    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 Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 5 Sat Aug 19, 2017 2:33 pm
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us