It's not really as much going on as you might think.  The counters are for 
accounting of automation script related commands, there are 104 discrete 
command sets and as each is used the counter for that subset is updated.  
Scripts really tend to be pretty small and run in a fraction of a second, but 
even on a long running script (something that runs 24x7 for a couple years), 
the number of times that any individual command gets processed tends to be 
fairly reasonable, but the 7 digits makes sure we won't ever overrun an 
individual counter even if they run a continuous looping script for a few 
years.  For most scripts, the majority of the counters remain unused, and the 
104 ZAP's to initialize them is (mostly) wasted effort.

The "average" script size is under 25 lines, so the init process is wasted 
effort for a great percentage of the 104 fields.  

I'm not sure that I would gain anything from the suggestion of making them 
fullword fields.  Reducing the limit to a little over 4 billion from 9 billion 
is probably not a big deal, but I'm not sure that much is saved changing the 
current AP to adding to a Fullword.  Am I wrong?

Brian

On Sat, 29 Nov 2025 23:45:10 -0600, Keven Hall <[email protected]> wrote:

>I have to wonder how significant the CPU time saving from using three MVC 
>instructions versus 104 ZAP instructions is when weight against the thousands 
>of AP instructions that are being performed against those seven digit pack 
>decimal counters.
>
>Keven Hall
>
>
>> On Nov 29, 2025, at 22:31, Steve Smith 
>> <[email protected]> wrote:
>> 
>> MVC "ripple" initialization isn't limited to 1-byte.
>>  ZAP   P1,=P'0'
>>  MVC  P2(256),P1  Init P2-P65
>>  MVC  P66(156),P65 Init P66-P104
>> 
>> Check my math...  better yet use EQU and DC to do the math.
>> 
>> sas
>> 
>>> On Sat, Nov 29, 2025 at 10:35 PM Brian Westerman <
>>> [email protected]> wrote:
>>> 
>>> Hi,
>>> 
>>> I have a program in which I have 104 PL4 fields tht are used for various
>>> counters, and when the program starts it spends a significant amount of
>>> time initializing all of those fields to zero.
>>> 
>>> we used to use ZAP field,=PL4'0' and then I found an entry (on the web)
>>> that said it would be "slightly" faster to use MVC, so I changed it to 104
>>> MVC filed,=PL4'0'.
>>> 
>>> Is there not a quicker way to do this?  I know that I can ripple the first
>>> byte of a field for up to 256 bytes with a single instruction, but can that
>>> same type of thing be done with a 4 byte packed field?
>>> 
>>> If not, is there a quicker way to initialize these fields without doing
>>> each one separately?
>>> 
>>> Thanks for any tips.
>>> 
>>> Brian
>>> 

Reply via email to