View previous topic :: View next topic
|
Author |
Message |
vamseepotti
New User
Joined: 21 Oct 2003 Posts: 45
|
|
|
|
How to Browse vsam files through CICS?
Vamsee... |
|
Back to top |
|
|
mdtendulkar
Active User
Joined: 29 Jul 2003 Posts: 237 Location: USA
|
|
Back to top |
|
|
ssprabhu
New User
Joined: 25 Apr 2005 Posts: 67 Location: pune
|
|
|
|
Is it Possible to Browse a file thru CICS |
|
Back to top |
|
|
vidhyanarayanan
New User
Joined: 23 Dec 2005 Posts: 52
|
|
|
|
Hi,
We can browse vsam files using READNEXT and READPREV
commands. As vsam files are variable length in most of the cases,
WS-LENGTH should be populated with maximum record length
before issuing READ command. |
|
Back to top |
|
|
ssprabhu
New User
Joined: 25 Apr 2005 Posts: 67 Location: pune
|
|
|
|
vidhyanarayanan ,
Plz tell me in detail how to Browse VSAM thru CICS.
where to give this readnext & readprev commands in CICS session.
plz mail me the complete steps ....
plzzzzzzz |
|
Back to top |
|
|
vidhyanarayanan
New User
Joined: 23 Dec 2005 Posts: 52
|
|
|
|
Hi,
EXEC CICS READNEXT/ READPREV FILE( FCTNAME) RIDFLD( )
INTO( )
LENGTH( )
KEYLENGTH( )
SYSID( )
END-EXEC. |
|
Back to top |
|
|
arunjosephaj
New User
Joined: 21 Mar 2006 Posts: 20 Location: India
|
|
|
|
The KEYLENGTH and SYSID options are required only if the file to be read resides on another system. |
|
Back to top |
|
|
rameshraj.satyam
New User
Joined: 15 May 2006 Posts: 9
|
|
|
|
in vsam browse mns here startbr ,readnext,readprev,resetbr,endbr option r used ok
when u r read high values ,lowvalus,readpre,readnext options thru files |
|
Back to top |
|
|
shivani_tech Warnings : 2 New User
Joined: 08 Jan 2006 Posts: 22 Location: UNITED KINGDOM
|
|
|
|
when u have to browse the vasm filefrom the starting using readnext then move low-values to key
when readprev then from the last record use move high values to key |
|
Back to top |
|
|
gskulkarni
New User
Joined: 01 Mar 2006 Posts: 70
|
|
|
|
Here are few steps to browse VSAM from CICS program. i am not giving full syntax. You can refer application programming reference on ibm site for syntax.
Step1. EXEC CICS STARTBR <give dataset, key, GTEQ or EQ or similar options,> END-EXEC this points to the record from which you want to start browsing. keyf given will determine which record to point at.
Step2. EXEC CICS READNEXT <give key variable as the one used in STARTBR above and other options> END-EXEC this will start reading records from the point set by STARTBR.
Perform step2 in loop. You do not have to modify Keyfield in readnext as it is taken care by CICS. whenever you do readnext next record will be read.
Step3. EXEC CICS ENDBR<give parametrs> END-EXEC. This ends the browsing.
Hope that helped. |
|
Back to top |
|
|
zanyzap4u
New User
Joined: 13 Dec 2008 Posts: 38 Location: Mexico City
|
|
|
|
Hello everyone,
I am trying to browse and read a KSDS cluster.
The code is given below :
Code: |
#include <stdio.h>
#include <stdlib.h>
main()
{
char *rec;
char *key="00000001";
EXEC CICS
STARTBR FILE("KSDSCLUS") RIDFLD(key) EQUAL KEYLENGTH(8);
EXEC CICS
READNEXT FILE("KSDSCLUS") INTO(rec) RIDFLD(key);
EXEC CICS
ENDBR FILE("KSDSCLUS");
return (0);
} |
But in the CICS region it is showing Abend in READNEXT line.
The abend code is :
Code: |
DFHAC2206 15:04:22 CICSB1 Transaction BM30 failed with abend AEYD. Updates to local recoverable resources backed out.
|
Kindly help. Where am I making the mistake. |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
ssprabhu
Quote: |
Plz tell me in detail how to Browse VSAM thru CICS.
where to give this readnext & readprev commands in CICS session.
plz mail me the complete steps |
This is basic CICS stuff. Have you performed any research on your own or
discussed with your co-workers? |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
zanyzap4u
Where is the area rec defined in your program ?
INTO(rec)
The AEYD abend indicates you do not have addressability to it. |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
zanyzap4u
I'm not a C++ programmer,
I see char *rec in your sample code is that the definition for rec area |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
zanyzap4u: I suggest you read up in the manuals (link at the top of this page) on the RESP attribute of CICS commands and use it. RESP traps error codes and can be tested to determine whether or not to go on. For example, if your STARTBR fails, there's no reason to try the READNEXT -- and RESP tells you if the STARTBR succeeded or not. |
|
Back to top |
|
|
zanyzap4u
New User
Joined: 13 Dec 2008 Posts: 38 Location: Mexico City
|
|
|
|
@Robert Sample
I have made some minor changes of the code.The modified code is
Code: |
#include <stdio.h>
#include <stdlib.h>
main()
{signed short int length=80;
signed long int resp;
unsigned char rec<:80:>;
char *key="00000001";
EXEC CICS
STARTBR FILE("KSDSCLUS") RIDFLD(key) EQUAL;
EXEC CICS
READNEXT FILE("KSDSCLUS") INTO(rec) RIDFLD(key) LENGTH (length)
printf("RECORD=%s\n",rec);
EXEC CICS
ENDBR FILE("KSDSCLUS");
return (0);
} |
I have checked in the CEDF transaction that STARTBR is givin NORMAL response,but after executing the READNEXT command AFCZ abend is coming.
Please reply me, and let me know if more information is required. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
the resp field should be part of your API syntax.
The AFCZ is useless, (not very definitive).
What is the RESP field value? that will enable you to determine the problem. (after you have encoded the RESP field in the API calls. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
From the CICS Messages and Codes manual:
Quote: |
3.8.20 AFCZ
AFCZ
Explanation: The transaction issued a file request resulting in a call to the main file control program (DFHFCFR). A "disastrous error" response was returned from DFHFCFR to its caller.
System Action: At the time the error is detected, CICS writes a message to the console, records an exception trace entry, and takes a system dump. The trace and dump identify the point of error.
Subsequently, the task is abnormally terminated with a CICS transaction dump.
User Response: The system programmer should use the trace and dumps to determine what the error is, and why it has occurred.
Modules: DFHDMPCA, DFHEIFC |
So what's the CICS message written to the console? This is one of those errors that absolutely require more information to figure out what happened.
And if you're going to be doing much CICS coding, you need to find the CICS Messages and Codes manual and have it constantly available -- CICS abend code explanations can provide much detail about what the problem is. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
I'm looking at the z/OS V1R8 XL C/C++ Programming Guide and find in section 7.1.3.1 Using the CICS command-level interface these points:
Quote: |
When you are designing and coding your CICS TS application, remember the following:
* The EXEC CICS command and options should be in uppercase. The arguments follow general C or C++ conventions.
* Before any EXEC CICS command is issued, the EXEC Interface Block (EIB) must be addressed by the EXEC CICS ADDRESS EIB command.
* z/OS XL C/C++ does not support the use of EXEC CICS commands in macros. |
which makes me ask where your EXEC CICS ADDRESS EIB statement is. And I don't see the terminator for your READNEXT statement -- am I just missing it? |
|
Back to top |
|
|
zanyzap4u
New User
Joined: 13 Dec 2008 Posts: 38 Location: Mexico City
|
|
|
|
@Robert Sample
I missed semocolon after LENGTH(length)
I adding :
EXEC CICS ADDRESS EIB(dfheiptr);
just before STARTBR. but it doesnt help.
I am trying..
and
Quote: |
User Response: The system programmer should use the trace and dumps to determine what the error is, and why it has occurred. |
how do we do this trace and dump. I was looking in the manuals, but cudnt understand where nd how to do this. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
The trace and dump require your site system programmer for CICS to set up and run -- so you need to contact the site support group for help. However, you can look in the console log for the region and find the message without requiring a trace or dump; the message may indicate more about the problem. Without that message, we're not going to be able to assist you. |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
zanyzap4u
Do you have a CICS systems support group you can call for assistance? |
|
Back to top |
|
|
|