TESTCB and SHOWCB



High Level Assembler(HLASM) for MVS & VM & VSE

TESTCB and SHOWCB

Postby michel123 » Wed Apr 06, 2011 7:48 pm

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.
michel123
 
Posts: 58
Joined: Tue Dec 28, 2010 12:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: TESTCB and SHOWCB

Postby enrico-sorichetti » Wed Apr 06, 2011 9:27 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: TESTCB and SHOWCB

Postby michel123 » Wed Apr 06, 2011 10:13 pm

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?
michel123
 
Posts: 58
Joined: Tue Dec 28, 2010 12:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: TESTCB and SHOWCB

Postby steve-myers » Wed Apr 06, 2011 11:01 pm

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.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: TESTCB and SHOWCB

Postby enrico-sorichetti » Wed Apr 06, 2011 11:03 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: TESTCB and SHOWCB

Postby michel123 » Thu Apr 07, 2011 1:50 am

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.
michel123
 
Posts: 58
Joined: Tue Dec 28, 2010 12:28 am
Has thanked: 0 time
Been thanked: 0 time


Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post