I am clearly confused.

I got an off-list note from Sam Golob asking me to submit an actual fix, so
I downloaded CBT 617 to have a clean copy to start from and it is *not* the
source of the program I am using (and complaining about here).

It *does* however have the same bug:

BINTDECR:                                
NUMERIC DIGITS 20                        
ARG LITERAL                              
INTZ = "LITERAL = C2X(''LITERAL'')"      
INTERPRET INTZ                           
...

Not sure exactly where to go from here. This misuse of ARG for binary fields
seems to be pervasive! I don't have the time to be "Mr. Fix all the CBT Rexx
misuses of ARG."

If you are using any Rexx code that processes binary data (such as SMF
records) you might want to do a quick FIND on ARG and see if it has the same
problem. Easy to fix:

ARG FOO becomes FOO = ARG(1)

ARG FOO BAR SOJACK becomes

FOO = ARG(1)
BAR = ARG(2)
SOJACK = ARG(3)
Etc.

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On
Behalf Of Charles Mills
Sent: Monday, April 13, 2020 6:08 PM
To: [email protected]
Subject: Apparent bug in CBT 617 SMFREPT

Unless I am confused there is a nasty little bug in several places in the
subject program. If you are using it you might want to fix it. If you are
the person who maintains the tape (Sam Golob?) you might want to fix it, or
if you don't trust me, at least put a note in the program to this effect.

Consider the following subroutine, which takes as a parameter a binary SMF
Seconds*100 timestamp:
        
FmtHHMMSS: Procedure                                                       
  Arg SecsX100Bin                                                          
  SecsX100 = C2D(SecsX100Bin)                /* Get to Rexx Decimal */     
  Hunds    = RIGHT((SecsX100 // 100), 2, 0)  /* Remainder Mod 100 = .hh */ 
  Work     = Trunc(SecsX100 / 100)           /* Get rid of hundredths */   
  Secs     = Right((Work // 60), 2, 0)       /* Remainder Mod 60 = secs */ 
  Work     = Trunc(Work / 60)                /* Get rid of seconds */      
  Mins     = Right((Work // 60), 2, 0)       /* Remainder Mod 60 = Mins */ 
  Hours    = Right(Trunc(Work / 60), 2, 0)   /* Get rid of minutes=hours*/ 
  Return Hours || ':' || Mins || ':' || Secs || . || Hunds 

Do you see the bug there? ARG is short for PARSE UPPER ARG, and converting a
binary time to upper case introduces a subtle change in the value. There are
several other subroutines with the same problem.

The solution is to change that first line of code to, for example,
SecsX100Bin = Arg(1)

Someone give me a shout if I am wrong.

Charles

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to