×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
I have looked an I can't find a solution. This is example of what I am
trying to accomplish. Is it possible? Does anyone have an example?
I get this when it sorts.
NB(1) = 5.
NB(2) = 2.
NB(3) = 0.
NB(4) = -6.
NB(5) = -4.
NB(6) = -3.
NB(7) = 0.
NB(8) = 0.
NB(9) = 0.
NB(10) = 0.
I want to get:
NB(1) = 5.
NB(2) = 2.
NB(3) = 0.
NB(4) = -3.
NB(5) = -4.
NB(6) = -6.
NB(7) = 0.
NB(8) = 0.
NB(9) = 0.
NB(10) = 0.
This is a sample of the code that I use. I
H BNDDIR('QC2LE')
D qsort PR ExtProc('qsort')
D base * value
D num 10U 0 value
D width 10U 0 value
D compare * procptr value
D LastName PR 10I 0
D parm1 like(name)
D parm2 like(name)
D name s 5
D num_names s 10i 0
d ds
D DS 5 dIM(10)
D NB 1s 0 OVERLAY(DS:*NEXT) INZ(0)
d A 1 OVERLAY(DS:*NEXT) INZ(' ')
c eval NB(1) = -6
c eval NB(2) = -3
c eval NB(3) = 5
c eval NB(4) = -4
c eval NB(5) = 2
c eval NB(6) = 0
c Eval A(1) = 'A'
c Eval A(2) = 'Y'
c Eval A(3) = 'G'
c Eval A(4) = 'H'
c Eval A(5) = 'D'
c Eval A(6) = 'B'
c eval num_names = 6
c callp qsort(%addr(NB): num_names:
c %size(name): %paddr('LASTNAME'))
c eval *inlr = *on
P LastName B
D LastName PI 10I 0
D parm1 like(name)
D parm2 like(name)
c select
c when parm1 < parm2
c return 1
c when parm1 > parm2
c return -1
c other
c return 0
c endsl
P E
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.