address "ISREDIT";"MACRO" /*rexx*/ /* DATE200 to be used as an IMACRO to change dates to yyyy/mm/dd */ /* David McRitchie -- "The REXX Toolbox" -- 1997/05/10 */ /* invokes macros: cols, @msg, @noteb */ /* For list such as the following it would be better to REFORMAT */ /* before running this macro */ /* REFORMAT 1 24 " " 25 34 " " 35 70 */ /* The alternative would be to use to use REXX to create the line*/ /* in most cases that are not tables it wouldn't make any diff. */ /* 1...5...10...15...20...25...30...35...40...45...50...55 */ /* @CMD 01.00 93/06/24 93/06/24 13:42 4 4 */ /* @DIRSTAT 01.00 86/05/07 93/09/29 15:59 28 28 */ /* @ICOPY 01.00 86/05/14 93/05/18 12:36 154 154 */ /* @PRINTX 01.00 92/01/16 93/05/03 13:43 29 29 */ /* BIGS 01.00 91/05/03 93/06/12 23:35 11247 1247 */ "x all"; msg = "===??? is that a date with a single digit ???===" MCHK = 0 "FIND all word x p'#$##$##'" if rc = 0 then "line_before .zcsr = msgline (msg)" "FIND all word x p'#$#$##'" if rc = 0 then "line_before .zcsr = msgline (msg)" "seek first 1 p'=' nx" if rc = 0 then mchk = mchk + 1 /* begin actual things that get changed */ "find word p'##$##$##' all" "(fcnt,flns) = find_counts" "(member) = member" "(imac) = imacro" "seek first p'=' 1 nx" if rc /= 0 then do; "cancel"; exit 0; end; "@note" changed imac "notenx" "cols" /* 12/05/85 12:12:12 93/12/05 1987/12/05 1993/12/05 19/12/19*/ /* 2/05/85 12:12:12 93/2/5 3/05/77 1993/12/05 19/12/19*/ "cursor = 1 0" "(row,col) = cursor" do hit = 1 to fcnt "cursor =" row col /* make it work with SPF/PC REXX/2 */ "find next word p'##$##$##'" "(row,col) = cursor" "(line) = line" row chngto = "" if substr(line,col+2,1) \= "/" then iterate hit if substr(line,col+5,1) \= "/" then iterate hit if "31" < substr(line,col,2) then chngto = "19"substr(line,col,8) if "00" = substr(line,col,2) then chngto = "20"substr(line,col,8) if "31" < substr(line,col+6,2) then chngto = "19"substr(line,col+6,2)"/"substr(line,col,5) if "00" = substr(line,col+6,2) then chngto = "20"substr(line,col+6,2)"/"substr(line,col,5) if chngto = "" then do; msg = "==???== What is" substr(line,col,8) "supposed to be?" "line_before .zcsr = msgline (msg)" iterate hit end if member = "DATE2000.txt" then @noteb "change word .zcsr .zcsr" col "p'##$##$##' '"chngto"'" else "change word .zcsr .zcsr" col "p'##$##$##' '"chngto"'" end /* Quick exit for mundane changes */ if mchk /= 0 then exit "x mcritchie all" "x d.mcr all" "x is03 all" "x 'formatted on' all" "seek first 1 p'=' nx" if rc /= 0 then do;"end";exit 0; end; "find p'####$##$##' all"