mvslovers / brexx370

MVS version of Vasilis Vlachoudis awesome rexx implementation
46 stars 11 forks source link

S0C4 #108

Closed rvjansen closed 10 months ago

rvjansen commented 11 months ago

On mvs-tk5 ( BREXX/370 V2R5M2 (Mar 02 2023) )

I did this:

 /* REXX */                                   
 ASCB = C2D(STORAGE(224,4))                   
 ASSB = C2D(STORAGE(D2X(ASCB+336),4))         
 JSAB = C2D(STORAGE(D2X(ASSB+168),4))         
 JBNM = STORAGE(D2X(JSAB+28),8)               
 JBID = STORAGE(D2X(JSAB+20),8)               
 USID = STORAGE(D2X(JSAB+44),8)               
 SAY 'JOBNAME='JBNM' JOBID='JBID' USERID='USID

I was expecting:

 JOBNAME=AB2217   JOBID=TSU00157 USERID=AB2217

I got this:

BRX0003E - ABEND CAUGHT IN BREXX/370                   

USER AB2217    RX        ABEND S0C4                    
EPA 001F1DF0  PSW 078D0000 001F9552  ILC 02  INTC 0010 
GR 0-3   00000000  002B2F20  00329A58  00000008        
GR 4-7   5040B07C  00000008  00000008  5040B07C        
GR 8-11  00000008  0020B200  001F9EEC  002B29C4        
GR 12-15 001F9390  002B2EBC  601F9502  0025E8E8        
Peter-Jacob commented 11 months ago

I tried it with the latest TK5 which does not abend but delivers invalid information. As I use a different way to fetch job information I suspect that your REXX uses invalid control block entries.

Here is my rexx for getting job information:

/ REXX /

job.name=strip(getstr(tiot(),8))

ssib=getadr(jscb()+316)

job.number=getstr(ssib+12,8)

proc=strip(getstr(tiot()+8,8))

stepn=strip(getstr(tiot()+16,8))

if stepn='' then job.step=proc

else job.step=proc'.'stepn

job.program=getstr(jscb()+360,8)

/ Output of JOB parms /

say job.name

say job.number

say job.step

say job.program

return

/ Some STORAGE function shortcuts /

getadr: return c2d(storage(d2x(arg(1)),4))

getstr: return storage(d2x(arg(1)),arg(2))

/ Some MVS CB shortcuts /

tcb: return getadr(540)

tiot: return getadr(tcb()+12)

jscb: return getadr(tcb()+180)

tcb: return getadr(540)

Von: René Vincent Jansen @.> Gesendet: Dienstag, 19. Dezember 2023 15:30 An: mvslovers/brexx370 @.> Cc: Subscribed @.***> Betreff: [mvslovers/brexx370] S0C4 (Issue #108)

On mvs-tk5 ( BREXX/370 V2R5M2 (Mar 02 2023) )

I did this:

/ REXX /
ASCB = C2D(STORAGE(224,4))
ASSB = C2D(STORAGE(D2X(ASCB+336),4))
JSAB = C2D(STORAGE(D2X(ASSB+168),4))
JBNM = STORAGE(D2X(JSAB+28),8)
JBID = STORAGE(D2X(JSAB+20),8)
USID = STORAGE(D2X(JSAB+44),8)
SAY 'JOBNAME='JBNM' JOBID='JBID' USERID='USID

I got this:

BRX0003E - ABEND CAUGHT IN BREXX/370

USER AB2217 RX ABEND S0C4
EPA 001F1DF0 PSW 078D0000 001F9552 ILC 02 INTC 0010 GR 0-3 00000000 002B2F20 00329A58 00000008
GR 4-7 5040B07C 00000008 00000008 5040B07C
GR 8-11 00000008 0020B200 001F9EEC 002B29C4
GR 12-15 001F9390 002B2EBC 601F9502 0025E8E8

— Reply to this email directly, view it on GitHub https://github.com/mvslovers/brexx370/issues/108 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ALA23N54THYCYR5PGBRZMCTYKGQE3AVCNFSM6AAAAABA3IVWBWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA2DQNZXGQ2TGNI . You are receiving this because you are subscribed to this thread. https://github.com/notifications/beacon/ALA23NZBB4RDMJGYSI5HWETYKGQE3A5CNFSM6AAAAABA3IVWBWWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHHUHORQ4.gif Message ID: @. @.> >

rvjansen commented 11 months ago

Hi Peter,Thanks! I will try when I get home; but this worked since the beginning of time as far as I remember; it certainly works on modern z/OS. I might be mistaken though, as I don’t remember exactly where I got his version from.Best regards,René.On 19 Dec 2023, at 13:59, Peter-Jacob @.***> wrote: I tried it with the latest TK5 which does not abend but delivers invalid information. As I use a different way to fetch job information I suspect that your REXX uses invalid control block entries.

Here is my rexx for getting job information:

/ REXX /

job.name=strip(getstr(tiot(),8))

ssib=getadr(jscb()+316)

job.number=getstr(ssib+12,8)

proc=strip(getstr(tiot()+8,8))

stepn=strip(getstr(tiot()+16,8))

if stepn='' then job.step=proc

else job.step=proc'.'stepn

job.program=getstr(jscb()+360,8)

/ Output of JOB parms /

say job.name

say job.number

say job.step

say job.program

return

/ Some STORAGE function shortcuts /

getadr: return c2d(storage(d2x(arg(1)),4))

getstr: return storage(d2x(arg(1)),arg(2))

/ Some MVS CB shortcuts /

tcb: return getadr(540)

tiot: return getadr(tcb()+12)

jscb: return getadr(tcb()+180)

tcb: return getadr(540)

Von: René Vincent Jansen @.***>

Gesendet: Dienstag, 19. Dezember 2023 15:30

An: mvslovers/brexx370 @.***>

Cc: Subscribed @.***>

Betreff: [mvslovers/brexx370] S0C4 (Issue #108)

On mvs-tk5 ( BREXX/370 V2R5M2 (Mar 02 2023) )

I did this:

/ REXX /

ASCB = C2D(STORAGE(224,4))

ASSB = C2D(STORAGE(D2X(ASCB+336),4))

JSAB = C2D(STORAGE(D2X(ASSB+168),4))

JBNM = STORAGE(D2X(JSAB+28),8)

JBID = STORAGE(D2X(JSAB+20),8)

USID = STORAGE(D2X(JSAB+44),8)

SAY 'JOBNAME='JBNM' JOBID='JBID' USERID='USID

I got this:

BRX0003E - ABEND CAUGHT IN BREXX/370

USER AB2217 RX ABEND S0C4

EPA 001F1DF0 PSW 078D0000 001F9552 ILC 02 INTC 0010

GR 0-3 00000000 002B2F20 00329A58 00000008

GR 4-7 5040B07C 00000008 00000008 5040B07C

GR 8-11 00000008 0020B200 001F9EEC 002B29C4

GR 12-15 001F9390 002B2EBC 601F9502 0025E8E8

Reply to this email directly, view it on GitHub https://github.com/mvslovers/brexx370/issues/108 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ALA23N54THYCYR5PGBRZMCTYKGQE3AVCNFSM6AAAAABA3IVWBWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA2DQNZXGQ2TGNI .

You are receiving this because you are subscribed to this thread. https://github.com/notifications/beacon/ALA23NZBB4RDMJGYSI5HWETYKGQE3A5CNFSM6AAAAABA3IVWBWWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHHUHORQ4.gif Message ID: @. @.> >

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

rvjansen commented 10 months ago

I agree this might be because of incompatibility of control blocks rather than error in brexx/370. I am able to reproduce but with wildly varying results, sometimes avoiding the SOC4 altogether.

rvjansen commented 10 months ago

Reopening because of development. If I run the ASVT chain for MAXU, so overrunning it, it fails where z/OS succeeds.

/* REXX */                
SAY C2X(STORAGE(10,4))    
SAY C2X(STORAGE(80FD2234,4))

yields

 00014138                                                     
      3 *-* SAY C2X(STORAGE(80FD2234,4))                      
 Error 40 running TSTSTO, line 3: Incorrect call to routine   
 ***                                                               

while on z/OS

 00FD7FC8 
 00000000 
 ***      

which is garbage but maybe I wanted that garbage.

On the tk5 system I can display that address with IMon:

       KEY 0 VIRTUAL STORAGE DATA AT ADDRESS FD2234 IN ASID 0012              4% 
   FD2200   80FD 2204  80FD 2208   80FD 220C  80FD 2210      |ØÙ..ØÙ..ØÙ..ØÙ..|  
   FD2210   80FD 2214  80FD 2218   80FD 221C  80FD 2220      |ØÙ..ØÙ..ØÙ. ØÙ..|  
   FD2220   80FD 2224  80FD 2228   80FD 222C  80FD 2230      |ØÙ..ØÙ..ØÙ..ØÙ..|  
   FD2230   80FD 2234 >80FD 2238   80FD 223C  80FD 2240 SSM  |ØÙ..ØÙ..ØÙ..ØÙ. |  
   FD2240   80FD 2244  80FD 2248   80FD 224C  80FD 2250      |ØÙ.àØÙ.çØÙ.<ØÙ.&|  
   FD2250   80FD 2254  80FD 2258   80FD 225C  80FD 2260      |ØÙ.èØÙ.ìØÙ.*ØÙ.-|  
   FD2260   80FD 2264  80FD 2268   80FD 226C  80FD 2270      |ØÙ.ÀØÙ.ÇØÙ.%ØÙ.ø|  
   FD2270   80FD 2274  80FD 2278   80FD 227C  8000 0000      |ØÙ.ÈØÙ.ÌØÙ.@Ø   |  
   FD2280   10FE F528  00FD 0800   0200 0000  0000 0000      |.Ú5. Ù. .       |  
   FD2290   8000 0000  8000 0000   0000 0000  0000 0000      |Ø   Ø           |  

so there is definitely something there.

rvjansen commented 10 months ago

and I updated that example with C2X() to be consistent, but the problem is not in C2X() - it is STORAGE that throws an "Incorrect call to routine"

mgrossmann commented 10 months ago

Hello René,

the problem here is your given address. The C runtime is also handling 31bit addresses. So we have to zero out the first 8 bits of every address given. In parallel I will doublecheck the compiler flags.

Bug fix is on the road.

Best Team BREXX :)

rvjansen commented 10 months ago

Private fix worked! Vielen Dank, team BREXX!