Page 1 of 1

SORT for sorting numeric values

PostPosted: Tue Dec 17, 2013 11:50 am
by sange-sherin
Hi,

I want to sort numeric fields (cols 94 to 105). So i gave sort card as

 //SYSIN    DD *             
     SORT FIELDS=(94,9,CH,A)
 /*                         
 ****************************


but i am not getting sorted output...
output:
 Command ===>                                                  Scroll ===
----+----9----+----0----+----1----+----2----+----3----+----4----+----5---
********************************* Top of Data ***************************
  -          000000005       -          ABLE STIK PRODUCTS               
  C          000000002       -          ABLE STIK PRODUCTS               
  -          000000046       00001      HAUSSER SCIENTIFIC               
  -          000000003       -          ABLE STIK PRODUCTS               
  -          000005404       -          EAST POINT PROPERTIES           


can anyone help me to find the problem?

Re: SORT for sorting numeric values

PostPosted: Tue Dec 17, 2013 1:05 pm
by BillyBoyo
Is your SORTIN dataset VB? If so, you'll need to add 4 to the start position of anything, to allow for the RDW, the four bytes at the start of each V record which include information about how long an individual record is.

If your records are not variable, please post the full sysout from the step.

Re: SORT for sorting numeric values

PostPosted: Tue Dec 17, 2013 1:32 pm
by sange-sherin
Hi Billy Boyo,

Ya, It is VB.

How to add 4 to the start position?

Can you help me to write sort card?

Re: SORT for sorting numeric values

PostPosted: Tue Dec 17, 2013 1:58 pm
by enrico-sorichetti
How to add 4 to the start position?
:shock: :shock: :shock:

just follow verbatim the suggestion

if the starting position for a FB record is 94
what do You get by adding 4 to it ?

Re: SORT for sorting numeric values

PostPosted: Tue Dec 17, 2013 3:01 pm
by NicC
Why, if your field is from 94 to 105, why are you sorting only on 94 to 102?

Re: SORT for sorting numeric values

PostPosted: Tue Dec 17, 2013 8:59 pm
by Terry Heinze
I suspect a typo. Probably meant to say "94 through 102".