IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Accessing VSAM from C/C++ - How to pass BUFND/BUFNI values


IBM Mainframe Forums -> HomeWorks & Requests
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
syamaprasad pg

New User


Joined: 04 Jul 2012
Posts: 2
Location: UK

PostPosted: Fri Jul 06, 2012 2:52 am
Reply with quote

Hi,
I am writing an Z/os C++ program to extract and process data from a VSAM KSDS file. The program is called by a PERL CGI script running under Z/os Webserver.
It all worked fine untill I increased the number of records in the VSAM file to around 10000. Then I saw a significant reduction in the response time of VSAM. This in turn resulted the CGI script to timeout and a "no responce" message to the web user.
When I tried tweaking the db performance by increasing the BUFND/BUFNI I found that there is nothing similar to MODECB or ACB in C/C++ , where I can give these parameters. fopen or fread/flocate doesn't accept any "AMP=" parameters. I can't use a DD statement to override BUFND/BUFNI (since this program is running under webserver). I don't think I can use __asm in c++ to supply assembler call to modecb(even if I can I don't know where I will get ACB name from ) .
Is this possible at all in C/C++? (i.e passing of AMP= parameter without using JCL DD statements?).
METAL C is not an option for me since I use STL in my programs :-)
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Jul 06, 2012 3:36 am
Reply with quote

The only thing that comes close is the "FIELDS" keyword of the "SHOWCB" Macro, where you can specify -

BUFNO - Number of buffers used for the data or index component.

As you've said, "BUFNI" and "BUFND" are normally defined at the "ACB" level.

Is there an equivalent to the "IFGACB" Macro in C/C++?

At X'10' of the above DSECT, you'll find label ACBBUFND and at X'12' you'll find ACBBUFNI. Both are aligned halfwords.

To establish addressability (R10 used as an example with VSAMACB the label for the ACB) -

Code:

          LA    R10,VSAMACB         POINT TO 'ACB'
          USING IFGACB,R10          INFORM ASSEMBLER         
          OPEN  ((R10),(INPUT)),    OPEN ACB AS 'INPUT', AMODE=31       X
                MODE=31

HTH....
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 06, 2012 3:41 am
Reply with quote

Have you tried an ALTER on the cluster to give it more BUFFERSPACE?
Back to top
View user's profile Send private message
syamaprasad pg

New User


Joined: 04 Jul 2012
Posts: 2
Location: UK

PostPosted: Fri Jul 06, 2012 12:20 pm
Reply with quote

Hi ,
Thanks for the quick replies
1) Alter on BUFSPC did't seem to do much for my program performance. At last I was able to achieve some of my performance goals by changing the program logic.
But since the AMP= parameters are so readily available for assembler , I am failing to see the reason why it is not open for a c++ program.
Still like to pass these parameters via the program and see if it gives some boost to my pgm.
2) I haven't found any VSAM assembly macro equalivant code for C++. Didn't find any thing that points to an ACB structure. It is all so well hidden :-). Did go thru the pseudo hlasm code generated by the compiler and searched for any mention of ACB. None so far.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> HomeWorks & Requests

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts How to pass the PARM value to my targ... COBOL Programming 8
Search our Forums:

Back to Top