View previous topic :: View next topic
|
Author |
Message |
delago
New User
Joined: 29 Jul 2005 Posts: 21 Location: Brazil
|
|
|
|
Hi.
I need a little help with a VSAM file.
I create a new program and it read a VSAM file. This program run in three jobs on sequence. When the first job finished, the second start and the same is happen with third job.
Sometimes one of jobs stop with when read a VSAM file. It send me a file status 47.
What I can to stop this error?
I thought this error ocurred when two jobs running in the same time and using the same file. But now, I don't what to do.
Every help is welcome.
That's the VSAM's information in my program:
Code: |
SELECT CTRNSA ASSIGN TO CTRNSA
ORGANIZATION INDEXED
ACCESS DYNAMIC
RECORD KEY CNSA-CLE
FILE STATUS WS-CTRNSA-FS
FD CTRNSA
DATA RECORD FIC-NSA.
01 FIC-NSA.
02 CNSA-CLE.
03 CNSA-VDRPCL PIC 9(007).
03 CNSA-FORNEXT PIC 9(003).
03 CNSA-FILLER PIC X(015).
02 CNSA-NSAREMESSA PIC 9(005).
02 CNSA-NSARETORNO PIC 9(005).
02 CNSA-DESCRICAO PIC X(020).
... and this is the instruction to read....
READ CTRNSA
KEY IS CNSA-CLE
INVALID KEY
DISPLAY 'INVALID KEY FS = ' WS-CTRNSA-FS.
IF WS-CTRNSA-FS NOT EQUAL ZERO
DISPLAY 'E ****************************************'
DISPLAY 'E ****** FILE CTRNSA **********'
DISPLAY 'E ****************************************'
DISPLAY 'E * CTRNSA ==> ' CNSA-CLE
DISPLAY 'E * ERROR IN READ VSAM FS = ' WS-CTRNSA-FS
DISPLAY 'E * THE PROGRAM WILL BE CANCELL. *'
DISPLAY 'E ****************************************'. |
Thank's.
P.S.: Sorry for my english...a long time not write anything. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Additionally, I would suggest that add the second variable to your FILE STATUS clause.
Since the problem is due to the open status of the file, I'd suggest that a display of a litteral and the file status be displayes after each open and close, such as DISPLAY 'OPEN-1*' WS-CTRNSA-FS '*'. |
|
Back to top |
|
|
mnnarayankar
New User
Joined: 21 Jan 2008 Posts: 23 Location: bangalore
|
|
|
|
Hi,
Please, can you show the full code?
Thanks,
Mohan N. |
|
Back to top |
|
|
delago
New User
Joined: 29 Jul 2005 Posts: 21 Location: Brazil
|
|
|
|
Hi,
Now the information:
JCL...
Code: |
//CTRNSA DD DSN=PCTL.VSM.CTRNSA1,DISP=SHR
|
...and the abend information...
Code: |
.IGD104I PCTL.ABENDAID.BATCH.SHRD.REPTFILE RETAINED, DDNAME=SYS00001RETAINED, DDNAME=SYS00001
.IEF237I 8048 ALLOCATED TO SYS00002
.IEF237I 8048 ALLOCATED TO SYS00003
.AB400A ===== ABEND-AID =====
. REPORT WRITTEN TO: PCTL.ABENDAID.BATCH.SHRD.REPTFILE E
. REPORT NUMBER: 002092
. JOB-WPCREN02 STEP-NEFECAR
. LE COND CODE=CEE3250C / EXPECTED COMP CODE=U0000
.IGD104I PCTL.ABENDAID.BATCH.REPTFILE RETAINED, DDNAME=SYS00003RETAINED, DDNAME=SYS00003
.IGD104I PCTL.ABENDAID.BATCH.SHRD.REPTFILE RETAINED, DDNAME=SYS00002RETAINED, DDNAME=SYS00002
.IGD104I PCTL.ABENDAID.BATCH.SHRD.REPTFILE RETAINED, DDNAME=ABNLTERMRETAINED, DDNAME=ABNLTERM
.IEF285I DB2PCTL.WPCREN02.JOB06782.D0000107.? SYSOUT SYSOUT
.IEF472I WPCREN02 NEFECAR - COMPLETION CODE - SYSTEM=000 USER=0000 REASON=00000000 USER=0000 REASON=00000000
.IEF285I PCTL.NEUGES.LINKLIB KEPT KEPT
|
... in the final of displays...
Code: |
CEE3250C The system or user abend U 000 R=00000000 was issued.
From compile unit NEFECAR at entry point NEFECAR at compile unit offset +00001314 at entry offset +00001314
at address 000088BC.
<> LEAID ENTERED (LEVEL 10/15/2007 AT 09.21)
<> LEAID PROCESSING COMPLETE. RC=0 |
Thank's guys.
Fernando Delago |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
First, you didn't post the OPEN statement. If you get a file status 47 on a file, you've got to post the OPEN statement to have a chance of getting any help.
Second, if you're getting Abend Aid on the program, why are you not looking at the Abend Aid output for assistance? AA will tell you the line of code that caused the problem, and often diagnose it for you -- if not, the list of potential causes AA provides is a much better starting place. |
|
Back to top |
|
|
Raghu navaikulam
Active User
Joined: 27 Sep 2008 Posts: 193 Location: chennai
|
|
|
|
Hi delago
Try to use VSAM status code rather than two character File Status.
You can the examples of using VSAM file status in the manual
Enterprise COBOL for z/OS and OS/390 Programming Guide
This enhanced VSAM status code give you detailed information rather than two character FILE STATUS.
Regards
Raghu |
|
Back to top |
|
|
delago
New User
Joined: 29 Jul 2005 Posts: 21 Location: Brazil
|
|
|
|
Sorry people.
This is the command open when use a VSAM file...
OPEN INPUT ARQFATCE
I-O CTRNSA
OUTPUT ARQFATCS
TOTIMPRE.
Thank's Raghu. I will search this in the manual. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Again...
Since the problem is due to the open status of the file, I'd suggest that a display of a litteral and the file status be displayed after each open and close, such as DISPLAY 'OPEN-1*' WS-CTRNSA-FS '*'. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
I agree with CICS Guy -- if the OPEN got a file status 35, 37, 39 (among others) and you're not checking, a READ file status of 47 makes a lot of sense. Display the file status (if not 00 or 97 at least); that will probably clarify things considerably. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
I was taught early on to check the file status after every I/O command of any file. |
|
Back to top |
|
|
Guruvayur1
New User
Joined: 04 May 2009 Posts: 1 Location: India
|
|
|
|
VSAM file status 47 occurs when a file is not opened in input or I-O mode is "READ". In this case since the same file is being used in all the three steps. Ensure that file is opened in required mode in each step. Also handle file-status for all the operations done on the file in all the three steps. |
|
Back to top |
|
|
|