On Tue, 12 Jun 2018 14:19:39 -0500, John McKown wrote: >On Tue, Jun 12, 2018 at 2:01 PM Bill Ashton wrote: > >> Since the OP is trying to fit D + date into a 6-character field, why not >> use a modified format like Dyyxdd, where x is a hex value for the month. In >> this case, Jan = 1, Sep = 9, Oct = A, Nov = B, and Dec = C. That would make >> the vol reference earlier D18611 as expected. and then if it were November >> 11, it would be D18B11. >> >That's a decent solution. The only possible problem is that the DSN will >not collate correctly in EBCDIC because A..C come before 0..9 . > I hate EBCDIC! (Granted in this case it's not bad design but bad luck.) In CMS I have dealt with this by PIPE ... | E2A | SORT | A2E ...
>> The simple Rexx for this is: >> xmonths = "123456789ABC"; >> myvalue = "D" || Left(Date("O"),2) || Substr(xmonths, Left(Date("U"),2),1) >> || Left(Date("N"),2); >> You really don't need a table search to convert a small decimal number to a hexadecimal digit. (Solution left as an exercise for the student.) Given that Rexx has the YYDDD format built-in, I'll recommend it, repugnant though it is to non-mainframers. -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN