/*rexx*/ address "ISREDIT"; "MACRO (parm)" /* related macros ----- SPELL uses SCRIPT/VS */ /* related macros ----- @SPELLS uses SAS608 */ /* JCL used to load dictionary like is03.share.cntl(sasex021) */ /* Created by: David McRitchie, "The REXX Macros Toolbox", 1994/07/06 */ "(MEMBERX) = MEMBER " "(DSNX) = DATASET" "(lastno) = linenum .zlast" parm=translate(parm) /**********************************/ /* options: EDIT NX NOWORDS NOTES */ editP = pos('EDIT',parm) nxP=pos('NX',parm) if pos('NOWORDS',parm) > 0 then AUXDICT=""; else auxdict='auxdict.spell.saswords'; if pos('NOTES',parm) > 0 | editP >0 then optionsP="ls=80"; else optionsP='nonotes nonews ls=80 noterminal'; /***********************************/ "ISREDIT (DCHG) = DATA_CHANGED" dd = "TP"random() userid = sysvar('sysuid') sysuid = sysvar("sysuid") /**********************************************************/ espell="'"userid".@SPELLS."DD"INP.LIST'" q.="" x=msg('off') Address "TSO" 'free fi(espell)' Address "TSO" 'del' espell Address "TSO" 'ALLOC FI(ESPELL) NEW CAT SPACE(45 45) TRACKS' , 'UNIT(VIO) LRECL(255) RECFM(V B M) BLKSIZE(3156)' , "DSN("espell") REUSE" do i = 1 to lastno ADDRESS 'ISREDIT' '(SPELLREC) = LINE' I if nxP > 0 then do ADDRESS 'ISREDIT' '(XSTAT) = XSTATUS' I if xstat \= "NX" then spellrec = " " end q.i=spellrec; q.0=i end Address "TSO" "EXECIO * DISKW ESPELL (STEM Q. FINIS" Address "TSO" "FREE FI(ESPELL)" q.="";q.0=0 /**********************************************************/ Address "TSO" 'free fi(infile) fi(saslog) fi(sysin)' saslog = "'"userid".@SPELLS."dd"LOG.list'" Address "TSO" 'del' saslog Address "TSO" 'ALLOC FI(saslog) NEW CAT SPACE(45 45) TRACKS' , 'UNIT(TESTDISK) LRECL(255) RECFM(V B M) BLKSIZE(3156)' , "DSN("saslog") REUSE" sysinxx = userid".@SPELLS."dd"SAS.list" sysin = "'"sysinxx"'" address "TSO" "del" sysin /* file will be created in REXX usin EXECIO below */ spellout = "'"userid".spell.out'" address "TSO" "del" spellout /* dataset will be created by SAS */ /* create a SAS program in FILE(SYSIN) from q. thru execio */ q.1="options ls=80;" q.2="filename print " spellout "unit=testdisk recfm=fb lrecl=80" q.3=" blksize=6800 disp=(new,catlg,catlg) reuse;" q.4="filename espell "espell" disp=shr;" q.5="libname AUXDICT 'sys6.sas608.auxdict' disp=shr;" q.6=" " q.7="PROC PRINTTO PRINT="spellout";" q.8 =" " q.9 ="PROC SPELL IN=espell verify suggest" /* auxdict defaults to auxdict.spell.sasword unless NOWORDS option */ q.10=" dictionary=("AUXDICT" sashelp.base.names " q.11="sashelp.base.cities sashelp.base.cntries sashelp.base.states);" q.0=11; Address "TSO" 'ALLOC FI(SYSIN) NEW SPACE(5 0) TRACKS UNIT(VIO)' , 'LRECL(80) RECFM(F B) BLKSIZE(3120) ' , "da("sysin") reuse catalog" Address "TSO" "EXECIO * DISKW sysin (STEM q. FINIS" Address "TSO" "free file(SYSIN)" /*************************************************************/ ZEDLMSG = '** SAS608 invoked to check dictionaries **' ADDRESS 'ISPEXEC' 'CONTROL DISPLAY LOCK' ADDRESS 'ISPEXEC' 'DISPLAY MSG(ISRZ000)' address "TSO" "sas608 input('''"sysinxx"''')", "options('"optionsP"') ddlog(saslog) log('')" ZEDLMSG = '** Now processing SAS output for INFOLINEs **' ADDRESS 'ISPEXEC' 'CONTROL DISPLAY LOCK' ADDRESS 'ISPEXEC' 'DISPLAY MSG(ISRZ000)' x=msg(on) x=msg(off) if editP > 0 then do /* possible use for debugging */ ZEDSMSG = "espell" ZEDLMSG = 'Input file with words to be checked out' ADDRESS "ISPEXEC" "SETMSG MSG(ISRZ000)" Address "TSO" "$EDIT "espell ZEDSMSG = "saslog " ZEDLMSG = 'SASLOG file output' ADDRESS "ISPEXEC" "SETMSG MSG(ISRZ000)" Address "TSO" "$$browse saslog" /*browse the ddname*/ /*Address "TSO" "$EDIT "saslog*/ ZEDSMSG = "sas sysin" ZEDLMSG = 'SAS program -- sysin' ADDRESS "ISPEXEC" "SETMSG MSG(ISRZ000)" Address "TSO" "$EDIT "sysin ZEDSMSG = "misspelled word list" ZEDLMSG = 'spellout -- misspelled words, listing of' ADDRESS "ISPEXEC" "SETMSG MSG(ISRZ000)" Address "TSO" "$EDIT "userid".spell.out" ZEDSMSG = "" ZEDLMSG = "" ADDRESS "ISPEXEC" "SETMSG MSG(ISRZ000)" end Address "TSO" 'free fi(espell) free fi(infile) fi(saslog) fi(sysin)' address "TSO" "del" espell address "TSO" "del" saslog address "TSO" "del" sysin address "TSO" "ALLOCATE FILE(SYSIN) DATASET(*)" q.="" Address "TSO" "ALLOC FI(infile) DSN('"SYSUID".SPELL.OUT') SHR REUSE" q.="" ADDRESS "TSO" "EXECIO * DISKR infile (STEM Q. FINIS" address "TSO" "del" spellout x=msg('on') address "ISREDIT" address "ISREDIT" "eXclude all" do qcnt = 1 to q.0; p0=substr(q.qcnt,45,1); p1 = strip(substr(q.qcnt,1,35)); p2=substr(q.qcnt,45,36) /* reject if linenumber is non numeric */ if datatype(p0,'N') = 0 then iterate /* reject words with numbers or not a-z, and not A-Z */ if datatype(p1,'M') = 0 then iterate L=length(p1); if L = 1 then iterate if L < 10 then p1 = left(p1,10) qcntp1 = qcnt + 1 sugg = "" if qcntp1 <= q.0 then if substr(q.qcntp1,10,12)='Suggestions:' then sugg = substr(q.qcntp1,9) do i = 1 to words(p2) word = word(p2,i) word = strip(word,"T",",") if "(" = substr(word,1,1) then iterate errx = "Word Not Found: "p1 sugg wordp1 = word + 1 if word < lastno then address "ISREDIT" "LINE_BEFORE" wordp1 "= infoline (errx)" else address "ISREDIT" "LINE_AFTER" word "= infoline (errx)" address "ISREDIT" "XSTATUS" word "= NX" end end IF DCHG = "YES" then do note = "@SPELLS" time('N') '-- current data not saved', 'prior to invoking @SPELLS' "LINE_BEFORE .ZFIRST = Noteline (note)" "@DIRSTAT" end