From: John McKown <[email protected]>
What I do in this case is:
c c'a' x'fa' col1 col2 all
c c'b' x'fb' col1 cols all
c c'c' x'fc' col1 cols all
c c'd' x'fd' col1 cols all
c c'e' x'fe' col1 cols all
c c'e' x'ff' col1 cols all
sort col1 col2
c x'fa' c'a' col1 col2 all
c x'fb' c'b' col1 col2 all
c x'fc' c'b' col1 col2 all
c x'fd' c'd' col1 col2 all
c x'fe' c'e' col1 col2 all
c x'ff' c'a' col1 col2 all
--
John
Many thanks to John - this was an excellent suggestion - much more elegant
than what I was thinking of when I start to think about how I could code
the edit macro. After John's email, my edit macro is included below. The
variables specified are the 1st column to use for the sort, the last
column to be included, and whether you want it sorted ascending or
descending.
Example: HEXSORT 1 4 a
/*REXX.EXEC(HEX SORT) */
ADDRESS ISPEXEC
"ISREDIT MACRO (@COL1 @COL2 @AD)"
IF (@COL1= "") | (@COL2 = "") | (@CAD = "") THEN
DO
ZEDSMSG = "MISSING MARKERS"
ZEDLMSG = "HEXSORT COL1 COL2 AD"
"SETMSG MSG(ISRZ001)"
EXIT
END
"ISREDIT C C'A' X'FA'" @COL1 @COL2 " ALL"
"ISREDIT C C'B' X'FB'" @COL1 @COL2 " ALL"
"ISREDIT C C'C' X'FC'" @COL1 @COL2 " ALL"
"ISREDIT C C'D' X'FD'" @COL1 @COL2 " ALL"
"ISREDIT C C'E' X'FE'" @COL1 @COL2 " ALL"
"ISREDIT C C'F' X'FF'" @COL1 @COL2 " ALL"
"ISREDIT C C'F' X'FF'" @COL1 @COL2 " ALL"
"ISREDIT SORT " @COL1 @COL2 @AD
"ISREDIT C X'FA' C'A'" @COL1 @COL2 " ALL"
"ISREDIT C X'FB' C'B'" @COL1 @COL2 " ALL"
"ISREDIT C X'FC' C'B'" @COL1 @COL2 " ALL"
"ISREDIT C X'FD' C'D'" @COL1 @COL2 " ALL"
"ISREDIT C X'FE' C'E'" @COL1 @COL2 " ALL"
"ISREDIT C X'FF' C'F'" @COL1 @COL2 " ALL"
EXIT
**************************************************************************************
This e-mail message and all attachments transmitted with it may contain legally
privileged and/or confidential information intended solely for the use of the
addressee(s). If the reader of this message is not the intended recipient, you
are hereby notified that any reading, dissemination, distribution, copying,
forwarding or other use of this message or its attachments is strictly
prohibited. If you have received this message in error, please notify the
sender immediately and delete this message and all copies and backups thereof.
Thank you.
**************************************************************************************
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html