On Tue, 21 Mar 2023 16:51:17 +0000, Farley, Peter  wrote:

>Great routine ITschak.  I made two small improvements to the name and token 
>displays to better handle binary characters (less than '40'x) in each part.
>
Judicious use of  white space/indention helps/would help legibility.

Use of PROCEDURE EXPOSE could help robustness.

Does this actually "check for the existence of a specific name/token pair" as
the OP requested or merely dump the entire table?  Setting a compound symbol
would facilitate the former.

Was I mistaken about the need to retry in case of concurrent updates?


>Updated code for display subroutine:
>
>/* routine to report on name token pairs */             
>Donttp:                                                 
>Parse Arg ptr,title                                     
>Say title' level NTTP at 'D2X(ptr)                      
>eye = Storage(D2X(ptr),4)                               
>If eye \= 'NTTH' then Do                                
>Say '** Invalid eye catcher found for NTTP'             
>Return                                                  
>End                                                     
>base = C2D(Storage(D2X(ptr+64),4))                      
>Do While base \= 0                                      
>tcbt = C2X(Storage(D2X(base+4),4))                      
>name = Storage(D2X(base+8),16)                          
>token = C2X(Storage(D2X(base+24),16))                   
>nonprint = verify(name,xrange('40'x))                   
>if nonprint = 0 then                                    
>   Say 'Name 'name' from 'tcbt                          
>else do                                                 
>   name_bin = c2x(substr(name, nonprint))               
>   name = substr(name, 1, nonprint - 1)' + "'name_bin'"'
>   Say 'Name has binary characters: 'name' from 'tcbt   
>End                                                     
>display = X2C(token)                                    
>/* translate out characters between 00 and 3f */        
>display = TRANSLATE(display,,XRANGE(,'3f'x),'.')        
>Say ' Token = 'token' ('display')'                      
>base = C2D(Storage(D2X(base+64),4))                     
>End                                                     
>Say ''                                                  
>Return    

-- 
gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to