Page 1 of 1

TESTCB and SHOWCB

PostPosted: Wed Apr 06, 2011 7:48 pm
by michel123
Hello,

Can you tell me the difference between macro and TESTCB SHOWCB?

For example, why write a TESTCB after an OPEN rather than a SHOWCB?

OPENRTN EQU *
OPEN (VSAMFILE,(INPUT))
LTR R15,R15 * WAS OPEN SUCCESSFUL ???
BNZ BADOPEN * IF NOT, THEN QUIT
TESTCB ACB=VSAMFILE,OFLAGS=OPEN
BNZ BADOPEN

Thanks.

Re: TESTCB and SHOWCB

PostPosted: Wed Apr 06, 2011 9:27 pm
by enrico-sorichetti
why not look at the manuals Yourself,
if You have the competence to mangle ACBs You should at least have the competence or rather the willingness to read the manuals
and to understand the difference between test and show as explained

here for TESTCB--Test the contents of a control block field
http://publib.boulder.ibm.com/infocente ... 910488.htm

and here for SHOWCB--Extract the contents of control block fields
http://publib.boulder.ibm.com/infocente ... 910485.htm

just the titles in the macro description should hint You about the differences

Re: TESTCB and SHOWCB

PostPosted: Wed Apr 06, 2011 10:13 pm
by michel123
Thank you for your reply.

In fact, I was too fast because I deal with these macros documentation "z / OS DFSMS Macro Instructions V1R10.0 for Data Sets" which gives no explanation on the use but only on the syntax. Furthermore, I'm French speaking very little English!

Thank you for these links to the doc. "z / OS V1R6.0-V1R9.0 Communications Server SNA Programming" which gives a clearer explanation.

Just one question, When to use instead TESTCB SHOWCB?

Re: TESTCB and SHOWCB

PostPosted: Wed Apr 06, 2011 11:01 pm
by steve-myers
In your example the TESTCB is superfluous since the non-zero return code from the OPEN should be enough to determine if the ACB is open. If the OPEN macro specifies more than one ACB then each ACB should be checked if OPEN returns a non-zero return code.

I do very little VSAM, so I find find TESTCB and SHOWCB very confusing myself. I generally break the rule about examining the VSAM control blocks directly. This rule was established to make programs more portable between OS/360 type systems (like z/OS) and DOS type systems (like VSE), something that I doubt is actually done very often. To aid enforcement of this rule IBM isn't very forthcoming about where the real field definitions are located, but it isn't too hard to dig out the IFGACB and IFGRPL macros in z/OS and go directly to the fields in the ACB and RPL. Of course, the DFSMS folks then claim, "We want to be able to move those fields," something that hasn't happened in nearly 40 years, and it ain't gonna happen. In 1972 or so the party line was. "VSAM is the future, all those obsolete things like QSAM and BSAM are going to be pushed out." Another thing that hasn't happened, and ain't gonna happen. VSAM, after 20+ years of struggle did succeed in pushing ISAM out, but few people lament that disappearance. For what it's worth I'm one of the few people that do lament the loss of ISAM. Used properly, ISAM was very good, but it was seldom used properly. Most of the time VSAM performance is at least fairly consistent, something ISAM never could claim.

Re: TESTCB and SHOWCB

PostPosted: Wed Apr 06, 2011 11:03 pm
by enrico-sorichetti
the fact that You are a native french speaker does not make any difference :D

the name tells, as already said
my bad, in my previous reply I seemed to imply that TESTCB/SHOWCB were related to ACBs only
they like for example MODCB are related to almost all the vsam/vtam control block mangling

testcb <compares> a <control block field> with a value You provide
as in http://publib.boulder.ibm.com/infocente ... 00/x6w.htm
showcb <moves> a <control block field> to a field of Your choice
as in http://publib.boulder.ibm.com/infocente ... 00/x6s.htm

and for a more sophisticated example http://publib.boulder.ibm.com/infocente ... 00/x6u.htm

Re: TESTCB and SHOWCB

PostPosted: Thu Apr 07, 2011 1:50 am
by michel123
Thank you all for your very complete answers. I am currently studying the assembly from an old course written in French for VSE. And tests after macro execution was not complete. They did not address all macros; SHOWCB only.

Indeed, other macros exist and it is these that I found on the IBM site. But the subtleties of the documentation I do not always clear.
I have the problem of translation into French in addition to understanding as I work only this language.


Michel.