SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Technology Stocks : Y2K (Year 2000) Stocks: An Investment Discussion

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: tom rusnak who wrote (7148)10/26/1997 9:44:00 PM
From: TEDennis  Read Replies (2) of 13949
 
tom: OK .. one more quickie, then I'll drop this ...

The COBOL syntax provides the "IF NUMERIC" construct to allow programmers to 'pre-edit' data for numeric content. This was (and still is) used frequently to filter out bad input data from being saved in files or being used in calculations. Invalid data will cause all sorts of ugly things to happen to program logic. Like abends, for one.

The old COBOL compiler's implementation used to check fields for numeric content by linking off to a COBOL runtime routine that did the following (I'll word this in English so non-techies can play along) ...

1) Move all zone bits of the input field (x'F-F-F-F') to a work area.
2) Compare work area contents to '000000' (x'F0F0F0F0F0')
3) If work area = zeros, then the field is numeric. If not ... (and it won't be for bigitized fields) then it's NOT numeric and the IF NUMERIC test will fail.

So, any solution that fiddles with the zone bits will have to also prepare a 'replacement' runtime routine that 'allows' Bigits. But, if the purpose of the routine was to filter out invalid data, and Bigits are actually 'invalid' zoned decimal data ... uh .... well, I think you get my drift. How does the replacement routine know what's invalid, and what's 'real' Bigit?

By the way, I think there is at least one version of the compiler that expands the zone-check inline ... so there's no call to a runtime routine. Or, maybe that's a compiler option to optimize the object code for performance. I don't remember (getting older, you know).

And, of course, there are lots of assembler programs out there that do the same test-for-numeric process (it's an example in the Assembler Programmer's guide!). What will happen when they look at a 'bigitized' field? Need I say more?

4 digit expansion. Yep. That's the ticket.

Sure is a pretty day.

TED
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext