KIDS parser

I just posted a python script that extracts the routines out of a KIDS build (and multi-builds) and posted it here:

This may be useful in verifying that routines match the patch level that is listed in the 2nd line of the routine vs the KIDS build it came from.

Consider this very beta/alpha code.  Any additions/corrections appreciated.

Christopher Edwards



Re: "Unknown" pieces in your code

DAVID Whitten's picture

Incidentally, according to a comment in RTN^XPDIJ

;^XPD("XPDI",XPDA,"RTN",routine name)=0-install, 1-delete, 2-skip^checksum

so the first "unknown" in your code is an enumerated set.

I'm not sure why you think the 3rd & 4th pieces are checksums.

Could you tell me where in the code you read this ?

Dave Whitten



Unknown pieces

Christopher Edwards's picture


> I'm not sure why you think the 3rd & 4th pieces are checksums.

Here is what the .KID file has: (XU-8_SEQ-463_PAT-570.KID)

"RTN","XQ") 0^4^B25124681^B24858955 "RTN","XQ",1,0) XQ ; SEA/MJM - Menu driver (Part 1) ;06/16/2011 "RTN","XQ",2,0) ;;8.0;KERNEL;**9,46,94,103,157,570**;Jul 10, 1995;Build 3 "RTN","XQ",3,0)

Bolded section is what the unknowns are referring to.

Looking at the associated patch description:

Routine Name: XQ Before: B24858955 After: B25124681 **9,46,94,103,157,570**

B2512... is the checksum after and B2485 is the checksum before.

So, from the description you gave piece 1 is the set {0=install, 1=delete, 2=skip}?

Thanks! Christopher



Christopher Edwards's picture

Apparently when i posted my comment it got mangled.  It should be fixed now.





DAVID Whitten's picture
I knew I should have done more research. The code clearly was using the first piece, so I was sure that "meaning" was appropriate. The code was not using the checksum, so now we need to research what the 4 in the 2nd piece might mean. I agree that it looks like the 3rd & 4th pieces look like a checksum from what you got from the KIDS file. Trusting Comments in old code is rarely a good idea, and I got burned by it. D CHECK1^XTSUMBLD New CheckSum CHECK1^XTSUMBLD: This option determines the current checksum of selected routine(s). The Checksum of the routine is determined as follows: 1. Any comment line with a single semi-colon is presumed to be followed by comments and only the line tag will be included. 2. Line 2 will be excluded from the count. 3. The total value of the routine is determined (excluding exceptions noted above) by multiplying the ASCII value of each character by its position on the line and position of the line in the routine being checked. Select one of the following: P Package B Build Build from: Package Routine: DI DI Current total of 1 routine. Routine: DI value = 532793 done This checksum algorithm (in CHECK1^XTSUMBLD) probably needs to be coded in Python, by the way. As an aside, if you are using GT.M you need to make sure this %ZOSF("RSUM1") node is properly setup. It is different on Cache and GT.M, as Cache uses the ZLOAD command. MUMPS> W ^%ZOSF("RSUM1") N %,%1,%2,%3 S Y=0 F %=1,3:1 S %1=$T(+%^@X),%3=$F(%1," ") Q:'%3 S %3=$S($E(%1,%3)'=";":$L(%1),$E(%1,%3+1)=";":$L(%1),1:%3-2) F %2=1:1:%3 S Y=$A(%1,%2)*(%2+%)+Y (edited and re-sent)