Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
mannepalli

New User

Joined: 05 May 2008
Posts: 9
Location: Bangalore

 Posted: Thu Sep 09, 2010 3:17 pm    Post subject: How do a sort on signed BINARY numbers 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

smijoss

Active User

Joined: 30 Aug 2007
Posts: 114
Location: pune

Posted: Thu Sep 09, 2010 3:21 pm    Post subject:

 Quote: s9(8) comp

but your input and output data is not binary !!!!!!!!!
mannepalli

New User

Joined: 05 May 2008
Posts: 9
Location: Bangalore

 Posted: Thu Sep 09, 2010 3:42 pm    Post subject: Reply to: How do a sort on signed BINARY numbers its in binary only ..to make it understandable i have given in numbers.
dbzTHEdinosauer

Global Moderator

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

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

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

show us the hex.
mannepalli

New User

Joined: 05 May 2008
Posts: 9
Location: Bangalore

 Posted: Thu Sep 09, 2010 4:15 pm    Post subject: 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..
expat

Global Moderator

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

 Posted: Thu Sep 09, 2010 4:19 pm    Post subject: Post your job including the control statements
mannepalli

New User

Joined: 05 May 2008
Posts: 9
Location: Bangalore

Posted: Thu Sep 09, 2010 4:22 pm    Post subject:

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)                                        /*
dbzTHEdinosauer

Global Moderator

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

 Posted: Thu Sep 09, 2010 4:39 pm    Post subject: BI is unsigned binary, try FI
mannepalli

New User

Joined: 05 May 2008
Posts: 9
Location: Bangalore

 Posted: Thu Sep 09, 2010 4:47 pm    Post subject: Perfect .. ..its working .. Thanks Alot.. ..
dbzTHEdinosauer

Global Moderator

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

 Posted: Thu Sep 09, 2010 4:50 pm    Post subject: glad I guessed correctly, here is a link, by the way, for all the different fomat types
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am How to Generate JCL using Sort naveen katkuri DFSORT/ICETOOL 7 Tue Mar 13, 2018 3:50 pm Need better approach to create a sort... Vamshi Veludandi DFSORT/ICETOOL 8 Thu Mar 08, 2018 5:59 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us