/*rexx macro to simulate "cols" line command entered from the */ /* edit command line - prevents "COMMAND COLS NOT FOUND" MSG */ /* COLS Macro for REXX Exec, by Phillip Miller of */ /* Oklahoma Farm Bureau Mutual Insurance Company */ /* "TSO Times" Summer issue 1993 from Chicago-Soft, Ltd. 1993/10/04*/ /* Modifications David McRitchie to use MSGLINE and include parm(s)*/ /* in SPF/PC use NOTELINE with option to scroll notelines (=0.5) */ address ISREDIT "MACRO (ColsParm,Data)" /* optional ColsWide for additional scales */ "(width) = data_width" "(row,col) = cursor" NOTELINE = "NOTELINE" Parse version V1 V2 V3 V4 V5 /* should be fixed in SPF/PC 4.0 */ if v1 = "REXXSAA" | v1 = "REXX/2" then NOTELINE="NOTELINE"; else NOTELINE="INFOLINE" if Data \= "" then NOTELINE = "DATALINE" "(USTATE) = USER_STATE" /* Save current user state */ LDATA1 = "----+----1----+----2----+----3----+----4----+----5"||, "----+----6----+----7----+----8----+----9----+----0"||, "----+----1----+----2----+----3----+----4----+----5"||, "----+----6----+----7----+----8----+----9----+----0"||, "----+----1----+----2----+----3----+----4----+----5----+-" LDATA2 = "1...5...10...15...20...25...30...35...40...45...50"||, "...55...60...65...70...75...80...85...90...95..100"||, "..105..110..115..120..125..130..135..140..145..150"||, "..155..160..165..170..175..180..185..190..195..200"||, "..205..210..215..220..225..230..235..240..245..250..255." dlf = 0 up = 3 /* two notelines + existing line*/ if ColsParm \= "" then do if datatype(ColsParm,"N") \= 1 then colswide = 100 else colswide = colsparm if colswide > 2048 then do colswide = 2048 say "Apparent limit for noteline of 2048 in SPF/PC" end /* limit in tso edit is 256 anyway */ if width < colswide then colswide = width if ColsParm < 256 then do ldata1 = left(ldata1,ColsWide) ldata2 = left(ldata2,ColsWide) end end if width < 256 then do ldata1 = left(ldata1,width) ldata2 = left(ldata2,width) end "(num1,num2) = number" "NUMBER OFF" /* force nonumber mode on */ "(DLF,DLL) = DISPLAY_LINES" /* Line no. of 1st in display*/ if dlf = 0 then do dlf = 1 "line_after 0 = dataline "" """ end /* both of the following should be INFOLINE which is not in SPF/PC */ /* suggest using new SPF/PC option 0.5 SCROLL Yes */ "label" DLF "= .DLF 1" string = left("--- begin data lines added by COLS" colsparm data,70,"-") if noteline = "DATALINE" then "LINE_BEFORE .DLF = noteline (string)" string = left("----- end data lines added by COLS" colsparm data,70,"-") "LINE_BEFORE .DLF = " NOTELINE " (LDATA2)" /* Insert COLS line */ "LINE_BEFORE .DLF = " NOTELINE " (LDATA1)" /* Insert COLS line */ /* if ColsWide not blank then create another set of scales */ if colsparm \= "" then do do icard = 1 to length(colswide) NCard = "" do j = 1 to colswide NCard = NCard||substr(right(j,length(colswide),'0'),icard,1) end NCard = translate(NCard,'0',' ') "LINE_BEFORE .DLF = " NOTELINE " (NCard)" /* Insert COLS line */ end if noteline = "DATALINE" then do "LINE_BEFORE .DLF = noteline (string)" UP = UP + 2 end end "USER_STATE = (USTATE)" /* Restore user state */ If colsparm \= "" then up = up + length(colswide) "UP" up if v1 = "REXX/2" then "cursor =" row col /* spf/pc quick fix*/ "number" num1