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

How to Browse vsam files through CICS


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vamseepotti

New User


Joined: 21 Oct 2003
Posts: 45

PostPosted: Fri Feb 20, 2004 3:16 pm
Reply with quote

How to Browse vsam files through CICS?

Vamsee...
Back to top
View user's profile Send private message
mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 237
Location: USA

PostPosted: Fri Feb 20, 2004 5:29 pm
Reply with quote

Hello vamseepotti,

Look at the following link for more details.

CICS Application Programming Guide

Hope this helps,

Regards
Mayuresh Tendulkar
Back to top
View user's profile Send private message
ssprabhu

New User


Joined: 25 Apr 2005
Posts: 67
Location: pune

PostPosted: Mon Apr 24, 2006 7:02 pm
Reply with quote

Is it Possible to Browse a file thru CICS
Back to top
View user's profile Send private message
vidhyanarayanan

New User


Joined: 23 Dec 2005
Posts: 52

PostPosted: Mon Apr 24, 2006 7:19 pm
Reply with quote

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
View user's profile Send private message
ssprabhu

New User


Joined: 25 Apr 2005
Posts: 67
Location: pune

PostPosted: Mon Apr 24, 2006 7:37 pm
Reply with quote

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
View user's profile Send private message
vidhyanarayanan

New User


Joined: 23 Dec 2005
Posts: 52

PostPosted: Mon Apr 24, 2006 7:41 pm
Reply with quote

Hi,

EXEC CICS READNEXT/ READPREV FILE( FCTNAME) RIDFLD( )
INTO( )
LENGTH( )
KEYLENGTH( )
SYSID( )
END-EXEC.
Back to top
View user's profile Send private message
arunjosephaj

New User


Joined: 21 Mar 2006
Posts: 20
Location: India

PostPosted: Tue May 16, 2006 5:14 pm
Reply with quote

The KEYLENGTH and SYSID options are required only if the file to be read resides on another system.
Back to top
View user's profile Send private message
rameshraj.satyam

New User


Joined: 15 May 2006
Posts: 9

PostPosted: Wed May 17, 2006 12:23 pm
Reply with quote

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
View user's profile Send private message
shivani_tech
Warnings : 2

New User


Joined: 08 Jan 2006
Posts: 22
Location: UNITED KINGDOM

PostPosted: Wed May 17, 2006 12:55 pm
Reply with quote

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
View user's profile Send private message
gskulkarni

New User


Joined: 01 Mar 2006
Posts: 70

PostPosted: Thu May 18, 2006 3:15 pm
Reply with quote

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
View user's profile Send private message
zanyzap4u

New User


Joined: 13 Dec 2008
Posts: 38
Location: Mexico City

PostPosted: Mon Jan 19, 2009 3:02 pm
Reply with quote

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
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Mon Jan 19, 2009 9:19 pm
Reply with quote

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
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Mon Jan 19, 2009 9:23 pm
Reply with quote

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
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Mon Jan 19, 2009 10:09 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Jan 20, 2009 12:18 am
Reply with quote

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
View user's profile Send private message
zanyzap4u

New User


Joined: 13 Dec 2008
Posts: 38
Location: Mexico City

PostPosted: Tue Jan 20, 2009 6:52 pm
Reply with quote

@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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jan 20, 2009 7:00 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Jan 20, 2009 7:05 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Jan 20, 2009 7:16 pm
Reply with quote

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
View user's profile Send private message
zanyzap4u

New User


Joined: 13 Dec 2008
Posts: 38
Location: Mexico City

PostPosted: Wed Jan 21, 2009 11:58 am
Reply with quote

@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.. icon_confused.gif

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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Jan 21, 2009 5:52 pm
Reply with quote

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
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Wed Jan 21, 2009 8:23 pm
Reply with quote

zanyzap4u

Do you have a CICS systems support group you can call for assistance?
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts HILITE on Browse mode? TSO/ISPF 2
No new posts Using API Gateway from CICS program CICS 0
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top