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
 
Sorting data descending with the key as signed numbers

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

New User


Joined: 24 Nov 2007
Posts: 5
Location: Bangalore, India

PostPosted: Wed Nov 07, 2012 7:31 pm    Post subject: Sorting data descending with the key as signed numbers
Reply with quote

Hi,

I want to sort data in descending order . The key field for sorting is numeric data which can have negative value as well.

Given below is the step and the sort card that I coded

Code:
//P020D71  EXEC  PGM=SORT                                     
//SORTMSG  DD  SYSOUT=*                                       
//SORTIN   DD  DSN=INPUT FILE,         
//             DISP=(OLD,KEEP,KEEP)                           
//SORTOUT  DD DSN=OUTPUT FILE, 
//             DISP=(NEW,CATLG,DELETE),                       
//             DCB=(RECFM=FB,LRECL=140,BLKSIZE=0,DSORG=PS)     
//SYSIN    DD  *
      SORT FIELDS=(85,4,ZD,D)
/*       


The output data is coming sorted as expected for the records which has the key field with positive value.
However, for the records which has the key field with negative value, the sorting is not working correctly.
For example, given below is the part of the output data which has negative value in the key field.
Since -25 is greater than -34 , -51 or -56, it should have been placed above , however it is placed below.


Code:
,T1,01/01/2013,-056,2013-01-01,
,T1,12/27/2012,-051,2012-12-27,
,T1,12/10/2012,-034,2012-12-10,
,T1,12/01/2012,-025,2012-12-01,


But the records with positive value are getting sorted correctly

Code:
,T1,01/01/2012,+310,2012-01-01,
,T1,08/19/2012,+079,2012-08-19,
,T1,09/01/2012,+066,2012-09-01,



Please help me understand what is that I'm missing here.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Nov 07, 2012 7:36 pm    Post subject: Reply to: Sorting data descending with the key as signed num
Reply with quote

Well, if that is your file, your data is not ZD. It is SFF (look it up the data-types in the manual).

Try your SORT with SFF instead of ZD.
Back to top
View user's profile Send private message
Harish Pisharody

New User


Joined: 24 Nov 2007
Posts: 5
Location: Bangalore, India

PostPosted: Wed Nov 07, 2012 7:43 pm    Post subject:
Reply with quote

Bill, do you know if SFF is supported by DFSORT Rel 14.0 .

I'm getting Invalid Format error

Code:
1ICE000I J - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0
0            SORT FIELDS=(85,4,SFF,D)                         
                               $                             
 ICE018A M INVALID FORMAT                                     
 ICE052I J END OF DFSORT
Back to top
View user's profile Send private message
Harish Pisharody

New User


Joined: 24 Nov 2007
Posts: 5
Location: Bangalore, India

PostPosted: Wed Nov 07, 2012 8:06 pm    Post subject:
Reply with quote

Thanks Bill,

It worked correctly with FS data type.

Code:
SORT FIELDS=(85,4,FS,D)
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Nov 07, 2012 8:06 pm    Post subject: Reply to: Sorting data descending with the key as signed num
Reply with quote

Can you run this, please, and post the full sysout.

Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DUMMY
//SYSIN   DD   *
  OPTION COPY
/*


Edit: I think your DFSORT is an antique. Any chance of getting it upgraded? There'll be lots of benefits, like having a supported product.
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am

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