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

How do a sort on signed BINARY numbers


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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: 6966
Location: porcelain throne

PostPosted: Thu Sep 09, 2010 3:48 pm
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
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: 8797
Location: Welsh Wales

PostPosted: Thu Sep 09, 2010 4:19 pm
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
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: 6966
Location: porcelain throne

PostPosted: Thu Sep 09, 2010 4:39 pm
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
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: 6966
Location: porcelain throne

PostPosted: Thu Sep 09, 2010 4:50 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top