SHOWCB and register 13 (VSAM)



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

SHOWCB and register 13 (VSAM)

Postby michel123 » Mon Nov 21, 2011 11:42 pm

Hello,

IBM said in the Appendix H (Summary of register usage) indicate the need to address an ​​18-word save area before running macros: OPEN, CLOSE, GENCB, MODCB, SHOWCB and TESTCB.
Is it an additional zone and different from the usual savearea found at the top of the program for the transition between programs?
Is it save a second area?
michel123
 
Posts: 58
Joined: Tue Dec 28, 2010 12:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: SHOWCB and register 13 (VSAM)

Postby BillW » Tue Nov 22, 2011 2:50 am

It should be a standard save area that you chained up when your program was entered. Anytime you call a routine or some system services, the save area you provide is where your register contents are saved and restored from when control is passed back to your program. So, just guessing without looking, you provide the save area when your program is entered and you will be fine.

Ho this helps.
BillW
 
Posts: 20
Joined: Thu Nov 10, 2011 8:21 am
Has thanked: 0 time
Been thanked: 3 times

Re: SHOWCB and register 13 (VSAM)

Postby steve-myers » Tue Nov 22, 2011 6:05 am

BillW wrote:... Anytime you call a routine or some system services, the save area you provide is where your register contents are saved and restored from when control is passed back to your program. ...
Not quite. IBM macros that call an SVC usually (I can't think of any exceptions) do not require a program provided register save area. LINK and XCTL are exceptions, because the new program they invoke requires a register save area. I/O macros (GET, PUT, READ, WRITE, CHECK, SHOWCB, MODCB, ...) usually require a register save area.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: SHOWCB and register 13 (VSAM)

Postby michel123 » Tue Nov 22, 2011 6:18 pm

Hello,

I spent a SHOWCB without manipulating the register 13. Me and the macro returns a good return code. What is really SHOWCB?
michel123
 
Posts: 58
Joined: Tue Dec 28, 2010 12:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: SHOWCB and register 13 (VSAM)

Postby BillW » Tue Nov 22, 2011 11:04 pm

If you are asking what is the showcb is used for, then it is for the following. It is used to extract various fields from the control block in question. Perhaps, you wanted to find out the record length from the file, you would use the showcb to find this out. Or perhaps you wanted to find out the dataset name (after the ACB is open), you could use it for that purpose also. In other words, you can information from the control blocks that you could use to determine what processing you will do based on that information, or perhaps, to display on the console or generate a report with this information. If you don't know what you want to do, then you really don't need to use the showcb macro.
BillW
 
Posts: 20
Joined: Thu Nov 10, 2011 8:21 am
Has thanked: 0 time
Been thanked: 3 times

Re: SHOWCB and register 13 (VSAM)

Postby michel123 » Wed Nov 23, 2011 4:44 pm

I expressed myself badly. I meant: The macro SHOWCB generates a call to a module. This module uses a save area, so the iregister 13 at the input.

Should we store in the register 13 with the address of the save area systematically?
michel123
 
Posts: 58
Joined: Tue Dec 28, 2010 12:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: SHOWCB and register 13 (VSAM)

Postby dick scherrer » Thu Nov 24, 2011 1:28 am

Hello,

Anytime you write assembler, you neet to follow "standard linkage" conventions.

Entering your code you need to save the "caller's registers" into your save area and when exiting, you need to restore them.

Every place that i has worked that permits assembler coding, has their own standard - might be Macros might not, but it is always the same.

You should use whatever is the standard for the system you are using.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: SHOWCB and register 13 (VSAM)

Postby michel123 » Thu Nov 24, 2011 1:43 am

Okay, I will look and work more the question. I think I have some shortcomings.

Thank you.
michel123
 
Posts: 58
Joined: Tue Dec 28, 2010 12:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: SHOWCB and register 13 (VSAM)

Postby dick scherrer » Thu Nov 24, 2011 1:49 am

Hello,

I think I have some shortcomings.
Not to worry - once upon a time, we all did :)

It takes years - not weeks - to become proficient.

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: SHOWCB and register 13 (VSAM)

Postby BillW » Thu Nov 24, 2011 7:26 pm

Strictly speaking, when your program is entered, the register contents are stored in the callers save area pointed to by r13. You then chain your save area up (your save area may be static or dynamic), but the point here is that you do not save the contents of the callers registers in your save area. When you make a call to another routine, that routine stores the contents of the registers into your save area, then chains up his save area. To prove this to yourself, think about the conditions at entry. The first thing ones does is to stm r14,r12,12(r13) to save the callers register values into his area (granted, the initial caller smartly got this for you to isolate himself from any nefarious manipulation of the reg contents, so instead what happens when you call someone and that program calls someone further. You save your callers reg contents.
BillW
 
Posts: 20
Joined: Thu Nov 10, 2011 8:21 am
Has thanked: 0 time
Been thanked: 3 times

Next

Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post