On Wed, 13 Jul 2005 10:30:45 +1000, Shane Ginnane <[EMAIL PROTECTED]>
wrote:

>Roland (of all people !!!) had an issue with non-displayable chars causing
>a screen erasure.
>So to avoid similar problems, maybe you'd like to use the following instead
>- thanks again to Mark for the function, which was unashamedly stolen from
>IPLINFO.
>
>Shane ...
>
>/* REXX */
>NUMERIC DIGITS 16                            /* handle big addresses */
>CVT      = C2d(Storage(10,4))                /* point to CVT         */
>ECVT     = C2d(Storage(D2x(CVT + 140),4))    /* point to CVTECVT     */
>CTBL     = C2d(Storage(D2x(ECVT + 204),4))   /* pt to Cust anchor tbl*/
>say '*** Customer Anchor Table listing - used slots               ***'
>say '*** note: slots are counted from 1 to correlate with ShowzOS ***'
>say
>  Do I = 0 to 1023
>    ptr = (CTBL + (4*I))
>    TST = C2d(Storage(D2x(ptr),4))
>    If (TST <> '0') then do
>     isvcode = storage(D2x(TST),32)
>     call XLATE_NONDISP isvcode
>     isvcode = RESULT
> /* remove the +1 from the following to use zero based slot counting */
>     say 'Slot: 'I+1' ISV text: ' isvcode
>    end
>  End
>exit
>
>XLATE_NONDISP:       /* translate non-display characters to a "."    */
>Arg XLATEPRM
>XLATELEN = Length(XLATEPRM) /* length of parm passed to routine      */
>Do J = 1 to XLATELEN        /* check each byte for non-display chars */
>  If Substr(XLATEPRM,J,1) < '40'x then , /* and replace each char    */
>    XLATEPRM = OVERLAY('.',XLATEPRM,I)   /* that is non-displayable  */
>End                                      /* with a period (.)        */
>Return XLATEPRM
>

You left out a line of code (not sure why).  x'FF' will also cause
problems.


XLATE_NONDISP:       /* translate non-display characters to a "."    */
Arg XLATEPRM
XLATELEN = Length(XLATEPRM) /* length of parm passed to routine      */
Do I = 1 to XLATELEN                      /* check each byte for     */
  If Substr(XLATEPRM,I,1) < '40'x | ,     /* non-display characters  */
     Substr(XLATEPRM,I,1) = 'FF'x  then , /* and replace each char   */
    XLATEPRM = OVERLAY('.',XLATEPRM,I)    /* that is non-displayable */
End                                       /* with a period (.)       */
Return XLATEPRM

I think x'00' is valid also but I never change IPLINFO.   If you
check the archives I think STK ..er SUN Paul (AKA gil) gave me
this alternative once:

XLATE_NONDISP:       /* translate non-display characters to a "."    */
Return(translate( arg(1), left('',64,'.') xrange('40'x,'FF'x), ,
                                          xrange('00'x,'FF'x) ) )

Mark
--
Mark Zelden
Sr. Software and Systems Architect
Zurich North America and Farmers Insurance Group
mailto: [EMAIL PROTECTED]
Systems Programming expert at http://Search390.com/ateExperts/
Mark's MVS Utilities: http://home.flash.net/~mzelden/mvsutil.html

----------------------------------------------------------------------
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

Reply via email to