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
 
How do a sort on signed BINARY numbers

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
mannepalli

New User


Joined: 05 May 2008
Posts: 9
Location: Bangalore

PostPosted: Thu Sep 09, 2010 3:17 pm    Post subject: How do a sort on signed BINARY numbers
Reply with quote

Hi ..
I'm facing a problem in DFSORT while doing sorting signed binary numbers.

Example: in my input file i have (s9(8) comp) binary numbers and doing the sort in ascending order.

input file:

-3,
-5,
-1,
8,
9

out put file:

8,
9,
-5,
-3,
-1.

out put expected:

-5,
-3,
-1
8
9

How can i achieve the expected results..

Srinivas
Back to top
View user's profile Send private message

smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Thu Sep 09, 2010 3:21 pm    Post subject:
Reply with quote

Quote:
s9(8) comp


but your input and output data is not binary !!!!!!!!!
Back to top
View user's profile Send private message
mannepalli

New User


Joined: 05 May 2008
Posts: 9
Location: Bangalore

PostPosted: Thu Sep 09, 2010 3:42 pm    Post subject: Reply to: How do a sort on signed BINARY numbers
Reply with quote

its in binary only ..to make it understandable i have given in numbers.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Sep 09, 2010 3:48 pm    Post subject: Re: Reply to: How do a sort on signed BINARY numbers
Reply with quote

mannepalli wrote:
its in binary only ..to make it understandable i have given in numbers.


show us the hex.
Back to top
View user's profile Send private message
mannepalli

New User


Joined: 05 May 2008
Posts: 9
Location: Bangalore

PostPosted: Thu Sep 09, 2010 4:15 pm    Post subject:
Reply with quote

input file in HEX FORMAT:

FFFFFFFD = -3
FFFFFFFB = -5
FFFFFFFF = -1
0000008 = 8
0000009 = 9

Sort card= sort fields=(1,4,BI,A)

output file in HEX FORMAT:
0000008 = 8
0000009 = 9
FFFFFFFB = -5
FFFFFFFD = -3
FFFFFFFF = -1

Out put is logically its correct as per storage but mathamatically incorrect.
I'm just looking for solution.
Thanks..
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Sep 09, 2010 4:19 pm    Post subject:
Reply with quote

Post your job including the control statements
Back to top
View user's profile Send private message
mannepalli

New User


Joined: 05 May 2008
Posts: 9
Location: Bangalore

PostPosted: Thu Sep 09, 2010 4:22 pm    Post subject:
Reply with quote

JCL step for SORT that i used;

Code:

//STEP020  EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                   
//SYSPRINT DD SYSOUT=*                       
//SYSABOUT DD SYSOUT=*                       
//SYSUDUMP DD SYSOUT=*                       
//SORTIN   DD DSN=input file,disp=shr
//SORTOUT  DD DSN=out put file,             
//         DISP=(NEW,CATLG,DELETE),                             
//         UNIT=(SYSDA,25),                                     
//         DCB=(*.SORTIN),                                     
//         SPACE=(TRK,(100,100))                               
//SYSIN    DD *                                                 
  SORT FIELDS=(15,4,BI,A)                                       
/*
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Sep 09, 2010 4:39 pm    Post subject:
Reply with quote

BI is unsigned binary,
try FI
Back to top
View user's profile Send private message
mannepalli

New User


Joined: 05 May 2008
Posts: 9
Location: Bangalore

PostPosted: Thu Sep 09, 2010 4:47 pm    Post subject:
Reply with quote

Perfect .. ..its working ..

Thanks Alot.. ..
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Sep 09, 2010 4:50 pm    Post subject:
Reply with quote

glad I guessed correctly,

here is a link, by the way, for all the different fomat types
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

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