Thanks in advance.
B.
If you have a handful of items, then a simple bubble sort is the easiest.
If you have a few more records (two handsful??), then you can use a shell
sort (I have an example) or, if you're sorting masses of records then you'd
be best to call your installation SORT routine - this would be dead easy to
do.
Give us a bit more information and, I'm sure, someone will *SORT* you out!
:-)
Ken
/* REXX */
"ALLOC FI(SYSIN) LRECL(80) NEW DEL UNIT(VIO) SPACE(100) TRACK REU"
"ALLOC FI(SORTIN) LRECL(10) NEW DEL UNIT(VIO) SPACE(100) TRACK REU"
"ALLOC FI(SORTOUT) LRECL(10) NEW DEL UNIT(VIO) SPACE(100) TRACK REU"
MyStem.1 = 'AAA'
MyStem.2 = 'CCC'
MyStem.3 = 'BBB' /* N.B. the three stem 'rows' are out of sequence */
SortCard.1 = ' SORT FIELDS=(1,3,CH,A)'
SortParm = ' MSG=CC' /* Suppress Syncsort messages -
- syntax may vary for other sort programs */
"EXECIO 1 DISKW SYSIN (STEM SortCard. FINIS"
"EXECIO 3 DISKW SORTIN (STEM MyStem. FINIS"
ADDRESS LINKMVS "SORT SortParm"
"EXECIO 3 DISKR SORTOUT (STEM MyStem. FINIS"
SAY MyStem.1 MyStem.2 MyStem.3 /* displays 'AAA BBB CCC' */
/* The next line just puts the SYSIN allocation back for my ISPF session.
You may need to do your own thing here if you're running in batch
TSO or some other environment */
"ALLOC FI(SYSIN) DA(*) REU"
RETURN
Regards,
Mike.
ps - sorry about the legal bit that I assume follows this sentence (I don't
even get to see it) - If anyone knows a sneaky way of getting rid of such
things, let me know !
______________________________________________________________________
The information contained in this message may be CONFIDENTIAL and is
intended for the addressee only. Any unauthorised use, dissemination of
the information, or copying of this message is prohibited. If you are not
the addressee, please notify the sender immediately by return e-mail and
delete this message. Although this e-mail and any attachments are believed
to be free of any virus, or other defect which might affect any computer or
system into which they are received and opened, it is the responsibility
of the recipient to ensure that they are virus free and no responsibility
is accepted by M&G for any loss or damage from receipt or use thereof.
regards Wilco
Mike Jarrett <Mike_J...@MANDG.CO.UK> schreef in berichtnieuws
002567C2.0...@mailgate.mandg.co.uk...
>My kind of solution... But for what do you need the SYSIN for in your TSO
>session? Some special application? Not for the ordinary terminal input....
>That's what you have SYSTSIN for....
>> SortCard.1 = ' SORT FIELDS=(1,3,CH,A)'
>...
>> "EXECIO 1 DISKW SYSIN (STEM SortCard. FINIS"
I doubt that SORT will be interested in SYSTSIN. It knows 'SYSIN' and expects
to find instructions there.
P.s.: I would have...
"NEWSTACK"
push ' SORT FIELDS=(1,3,CH,A)'
"EXECIO" queued() "DISKW SYSIN (FINIS"
"DELSTACK"
...but that's just personal preference.
Frank Clarke
Tampa Area REXX Programmers' Alliance (TARPA)
Member of the REXX Language Assn
Join us at http://www.rexxla.org
(remove currency symbol when replying)
Frank Clarke <nisus$@mindspring.com> schreef in berichtnieuws
37a8b42d...@NEWS.mindspring.com...