Re: How would you do this?
- From: "Pete Dashwood" <dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 12 Mar 2007 13:51:31 +1300
"Rick Smith" <ricksmith@xxxxxxx> wrote in message
news:12v6pek1atd1a64@xxxxxxxxxxxxxxxxxxxxx
Excellent! Great stuff, Rick.
"William M. Klein" <wmklein@xxxxxxxxxxxxxxxxx> wrote in message
news:rrDIh.242220$k82.140284@xxxxxxxxxxxxxxxxxxxxxxxxx
to: comp.lang.cobol *and* IBM-MAINthat
IBM has (relatively) recently created an LE callable service, CEE3INF,
returns a "32-bit map" with information about what environment a programis
running in. See:http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CEEA3170/2.2.5.9
handle
Now, my question is how various "experienced" COBOL programmers would
such information (either in an IBM mainframe environment OR in otheror any
COBOL
environments for those who see this note and don't work in IBM mainframe
environments - but do get "bit maps")
1) Call a non-COBOL program to decode this map (e.g.. Assembler, C, PL/I
other language that can easily handle "bits")ways.
2) Do a "division" loop to figure out which bits are turned on?
3) Use 88-levels with hex literals to check for which bits were turned
on?
4) Use the LE (or comparable) "bit manipulation" routines?
5) Not use CEE3INF from COBOL?
6) Other?
***
Although I wouldn't LIKE it, I can imagine doing this in any of these
Obviously, when/if a COBOL compiler supports the '02 Standard Bit/Booleanthis
features, this becomes "trivial". However, as few (if any) compilers do
yet, I was wondering how programmers would handle this requirement.
There are a lot of "reserved" bits in the four full-words.
While some of these may become assigned, it seems
unlikely that any would be moved. As new bits become
assigned, a routine that processes all bits, such as a
"division loop" would, I believe, be more sensitive to
maintenance than one that extracts the bit fields directly.
Also one need not extract more than is desired.
Extracting these bit fields directly seems a rather
straight-forward process with intrinsic functions. The
exponents below are 31 minus the low-order bit number
of the field.
-----
compute c-bit = function mod
(function integer (member-id / (2 ** 28)) 2)
compute cobol-bit = function mod
(function integer (member-id / (2 ** 26)) 2)
compute amode = function mod
(function integer (env-info / (2 ** 17)) 4)
compute product-number = function integer
(gpid / (2 ** 24))
compute version = function mod
(function integer (gpid / (2 ** 16)) 256)
compute releasse = function mod
(function integer (gpid / (2 ** 8)) 256)
compute modification = function mod
(gpid 256)
-----
Pete.
.
- Follow-Ups:
- Re: How would you do this?
- From: Rick Smith
- Re: How would you do this?
- References:
- How would you do this?
- From: William M. Klein
- Re: How would you do this?
- From: Rick Smith
- How would you do this?
- Prev by Date: Re: How would you do this?
- Next by Date: Re: urgent job openings for Mainframe Technologies !!!
- Previous by thread: Re: How would you do this?
- Next by thread: Re: How would you do this?
- Index(es):
Relevant Pages
|
|