View previous topic :: View next topic
|
Author |
Message |
pravinj
New User
Joined: 10 Jun 2008 Posts: 24 Location: india
|
|
|
|
How to resolve VSAM file status 93
Control flow of the code:
For every input record from a flat file
1) Read VSAM using alternate key - loop through a sequence.
2) If specific condition becomes true, fields are updated rewritten.
Condition:
record 1 read in flat file -> read through the VSAM for existence -> if not, an entry in VSAM is written -> if available, entry is rewritten
i/p record1:
VSAM cluster searched through. (VSAM empty by this time)
new VSAM record written successfully (VSAM record 1)
i/p record2:
VSAM cluster searched through. Record not available, thereby new record written. (VSAM record 2)
i/p record3:
VSAM cluster searched through (VSAM rec 1 and 2). Record found (VSAM rec 1). Hence, record (VSAM rec 1) rewritten.
i/p record4 (problem area):
It reads through the first record (VSAM record 1). (read successful - but not the intended record)
reads the next record (VSAM record 2) (read failed - File status 93)
Please help in this regard. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Status Code 93 means resource not available. Since you didn't post actual code, all we can do is guess. Perhaps if you explain in more detail what you're doing, and show us code, we can make some suggestions. |
|
Back to top |
|
|
pravinj
New User
Joined: 10 Jun 2008 Posts: 24 Location: india
|
|
|
|
Cluster definitions:
DEFINE CLUSTER (NAME(xxxxxx.CLUSTER) -
VOL(*) -
UNIQUE -
CYL(120 120) -
FSPC(5 5) -
RECSZ(2334 11633) -
KEYS(14 1) -
INDEXED -
SPEED -
LOG(UNDO) -
SHR(2 3)) -
DATA (NAME(xxxxx.DATA) -
CISZ(12288)) -
INDEX (NAME(xxxxx.INDEX) -
CISZ (512))
Alternate index cluster:
DEFINE ALTERNATEINDEX(NAME(XXXXX.AIX.N01.CLUSTER) -
VOL(*) -
CYL(2 1) -
FSPC(5 5) -
RECSZ(36 36) -
KEYS(17 15) -
UPGRADE -
SHR(2 3) -
SPEED -
RELATE(XXXXX.CLUSTER) -
UNIQUEKEY) -
DATA (NAME(XXXXX.N01.DATA) -
CISZ(4096)) -
INDEX (NAME(XXXXX.AIX.N01.INDEX) -
CISZ (512))
Bild index:
BLDINDEX -
IDS(XXXXX.CLUSTER) -
ODS(XXXXX.AIX.N01.CLUSTER)
Defining Path:
DEFINE PATH ( -
NAME(XXXXX.PATH) -
PATHENTRY(XXXXX.AIX.N01.CLUSTER) -
UPDATE ) |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
-Amateur turning Pro |
answer the questions!
Select statements, FD, I/O statements.
JCL for step executing program.
listcat of vsam files, either before or after run, preferably both. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Looking at the DEFINE CLUSTER im wondering if the TS knows that the KEY positions are relative to zero. I can imagine that probably in the coding that phenomenon was overlooked.
For the rest i agree with the dino. |
|
Back to top |
|
|
pravinj
New User
Joined: 10 Jun 2008 Posts: 24 Location: india
|
|
|
|
The SELECT statement is as follows,
Code: |
SELECT TEMP-FILE ASSIGN TO TEMP
ORGANIZATION IS INDEXED
ACCESS IS RANDOM
RECORD KEY IS TMP-MASTKEY
ALTERNATE KEY IS TMP-ALT-KEY
FILE STATUS IS WS-TEMP-FILE-STATUS. |
File Description is as follows,
Code: |
FD TEMP-FILE
RECORD IS VARYING.
RECORD CONTAINS 1240 TO 11633 CHARACTERS.
01 TMP-RECORD.
02 TMP-DATA.
03 TMP-GROUP1.
05 TMP-FLAG1 PIC X.
05 TMP-MASTKEY.
10 TMP-PART1 PIC 9(7).
10 TMP-PART2 PIC 9(4).
10 FILLER REDEFINES TMP-PART2.
15 FILLER PIC X.
15 TMP-PART2-1 PIC X(3).
10 TMP-PART3 PIC 9(3).
05 TMP-ALT-KEY.
10 TMP-SS-10.
15 TMP-FIELD1 PIC X(9).
15 TMP-FIELD1-N REDEFINES TMP-FIELD1 PIC 9(9).
15 TMP-FIELD2 PIC X.
15 TMP-FIELD2-N REDEFINES
TMP-FIELD2 PIC 9(1).
10 TMP-FIELD-ALT-KEY PIC X(7).
.............. |
The statements related to this file in PROCEDURE DIVISION is as follows,
Code: |
OPEN I-O TEMP-FILE.
READ TEMP-FILE KEY IS TMP-ALT-KEY
IF WS-TEMP-FILE-STATUS = 00
<REWRITE THE FILE>
REWRITE TMP-RECORD
ELSE
<CREATE A NEW ROW IN THE FILE>
WRITE TMP-RECORD
ADD 1 TO WS-TEMP-WRITE
END-IF.
CLOSE TEMP-FILE. |
The file references in JCL are as follows,
Code: |
//TEMPL DD DSN=xxxxxx.CLUSTER,DISP=OLD
//TEMP DD SUBSYS=(BLSR,'DDNAME=TEMPL','BUFND=10','BUFNI=10')
//TEMP1L DD DSN=XXXXX.PATH,DISP=OLD
//TEMP1 DD SUBSYS=(BLSR,'DDNAME=TEMP1L','BUFND=10','BUFNI=10') |
Code'd |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Also:
Quote: |
listcat of vsam files, either before or after run, preferably both. |
Please note that the Code tag has been applied to your info. Please use the Code tag when posting code, jcl, data, etc. |
|
Back to top |
|
|
pravinj
New User
Joined: 10 Jun 2008 Posts: 24 Location: india
|
|
|
|
Yes, i'll use the CODE option starting from here.
LISTCAT information is provided herewith. Before run information will not be available, as the job which executes the module does have the steps of defining the clusters.
LISTCAT info of cluster (after run):
Code: |
IDCAMS SYSTEM SERVICES TIME: 02:24:44 11/26/09 PAGE 1
/* IDCAMS COMMAND */
LISTCAT ENTRIES(XXXXX.CLUSTER) -
ALL
CLUSTER ------- XXXXX.CLUSTER
IN-CAT --- UCAT.PRODPLEX.DV303C
HISTORY
DATASET-OWNER-----(NULL) CREATION--------2009.330
RELEASE----------------2 EXPIRATION------0000.000
SMSDATA
STORAGECLASS -----SC#DV3 MANAGEMENTCLASS-MC#DEV01
DATACLASS --------(NULL) LBACKUP ---0000.000.0000
BWO STATUS------00000000 BWO TIMESTAMP---00000 00:00:00.0
BWO---------------(NULL)
RLSDATA
LOG ------------------UNDO RECOVERY REQUIRED --(NO) FRLOG ------------(NULL)
VSAM QUIESCED -------(NO) RLS IN USE ---------(NO)
LOGSTREAMID-----------------------------(NULL)
RECOVERY TIMESTAMP LOCAL-----X'0000000000000000'
RECOVERY TIMESTAMP GMT-------X'0000000000000000'
PROTECTION-PSWD-----(NULL) RACF----------------(NO)
ASSOCIATIONS
DATA-----XXXXX.DATA
INDEX----XXXXX.INDEX
AIX------XXXXX.AIX.N01.CLUSTER
DATA ------- XXXXX.DATA
IN-CAT --- UCAT.PRODPLEX.DV303C
HISTORY
DATASET-OWNER-----(NULL) CREATION--------2009.330
RELEASE----------------2 EXPIRATION------0000.000
ACCOUNT-INFO-----------------------------------(NULL)
PROTECTION-PSWD-----(NULL) RACF----------------(NO)
ASSOCIATIONS
CLUSTER--XXXXX.CLUSTER
ATTRIBUTES
KEYLEN----------------14 AVGLRECL------------2334 BUFSPACE-----------25600 CISIZE-------------12288
RKP--------------------1 MAXLRECL-----------11633 EXCPEXIT----------(NULL) CI/CA-----------------60
SHROPTNS(2,3) SPEED UNIQUE NOERASE INDEXED NOWRITECHK NOIMBED NOREPLICAT
UNORDERED NOREUSE NONSPANNED
STATISTICS
REC-TOTAL--------------5 SPLITS-CI--------------0 EXCPS-----------------11
REC-DELETED------------0 SPLITS-CA--------------0 EXTENTS----------------1
REC-INSERTED-----------0 FREESPACE-%CI----------5 SYSTEM-TIMESTAMP:
REC-UPDATED------------2 FREESPACE-%CA----------5 X'C52514C7890E358B'
REC-RETRIEVED---------13 FREESPC---------88461312
ALLOCATION
SPACE-TYPE------CYLINDER HI-A-RBA--------88473600
SPACE-PRI------------120 HI-U-RBA----------737280
IDCAMS SYSTEM SERVICES TIME: 02:24:44 11/26/09 PAGE 2
SPACE-SEC------------120
VOLUME
VOLSER------------DV3412 PHYREC-SIZE--------12288 HI-A-RBA--------88473600 EXTENT-NUMBER----------1
DEVTYPE------X'3010200F' PHYRECS/TRK------------4 HI-U-RBA----------737280 EXTENT-TYPE--------X'40'
VOLFLAG------------PRIME TRACKS/CA-------------15
EXTENTS:
LOW-CCHH-----X'16A00000' LOW-RBA----------------0 TRACKS--------------1800
HIGH-CCHH----X'1717000E' HIGH-RBA--------88473599
INDEX ------ XXXXX.INDEX
IN-CAT --- UCAT.PRODPLEX.DV303C
HISTORY
DATASET-OWNER-----(NULL) CREATION--------2009.330
RELEASE----------------2 EXPIRATION------0000.000
PROTECTION-PSWD-----(NULL) RACF----------------(NO)
ASSOCIATIONS
CLUSTER--XXXXX.CLUSTER
ATTRIBUTES
KEYLEN----------------14 AVGLRECL---------------0 BUFSPACE---------------0 CISIZE--------------1024
RKP--------------------1 MAXLRECL------------1017 EXCPEXIT----------(NULL) CI/CA-----------------33
SHROPTNS(2,3) RECOVERY UNIQUE NOERASE NOWRITECHK NOIMBED NOREPLICAT UNORDERED
NOREUSE
STATISTICS
REC-TOTAL--------------1 SPLITS-CI--------------0 EXCPS------------------5 INDEX:
REC-DELETED------------0 SPLITS-CA--------------0 EXTENTS----------------1 LEVELS-----------------1
REC-INSERTED-----------0 FREESPACE-%CI----------0 SYSTEM-TIMESTAMP: ENTRIES/SECT-----------7
REC-UPDATED------------0 FREESPACE-%CA----------0 X'C52514C7890E358B' SEQ-SET-RBA------------0
REC-RETRIEVED----------0 FREESPC-----------134144 HI-LEVEL-RBA-----------0
ALLOCATION
SPACE-TYPE---------TRACK HI-A-RBA----------135168
SPACE-PRI--------------4 HI-U-RBA------------1024
SPACE-SEC--------------4
VOLUME
VOLSER------------DV3412 PHYREC-SIZE---------1024 HI-A-RBA----------135168 EXTENT-NUMBER----------1
DEVTYPE------X'3010200F' PHYRECS/TRK-----------33 HI-U-RBA------------1024 EXTENT-TYPE--------X'40'
VOLFLAG------------PRIME TRACKS/CA--------------1
EXTENTS:
LOW-CCHH-----X'00A70009' LOW-RBA----------------0 TRACKS-----------------4
HIGH-CCHH----X'00A7000C' HIGH-RBA----------135167
IDCAMS SYSTEM SERVICES TIME: 02:24:44 11/26/09 PAGE 3
THE NUMBER OF ENTRIES PROCESSED WAS:
AIX -------------------0
ALIAS -----------------0
CLUSTER ---------------1
DATA ------------------1
GDG -------------------0
INDEX -----------------1
NONVSAM ---------------0
PAGESPACE -------------0
PATH ------------------0
SPACE -----------------0
USERCATALOG -----------0
TAPELIBRARY -----------0
TAPEVOLUME ------------0
TOTAL -----------------3
THE NUMBER OF PROTECTED ENTRIES SUPPRESSED WAS 0
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 0 |
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Terminology note: this is flat out wrong:
Quote: |
<CREATE A NEW ROW IN THE FILE> |
Databases have rows. Files have records. If you do not understand the distinction, you are going to have many problems with mainframes.
The LISTCAT output does not match your original post of the description of your problem. LISTCAT says there are 5 records in the file, 2 of which have been updated. Yet your original post says the problem occurs on the fourth input record before it is output to the file.
From the code snippet you posted, it appears that you are opening and closing the file for every record. This is extremely wasteful of resources and should not be done. If this is not what you are doing, then you have not posted enough code for us to understand the process correctly.
Could you add display statements to see the key, alternate key, and file status codes for the open, each read, write and rewrite? That's probably the best way to figure out what is going on. Seeing these fields should give us more clues. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
your FD says the record is variable (a couple of times)
yet you do not show in your record description how the variable record is other than fixed. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
I see a inconsistency in the following :
RECORD CONTAINS 1240 TO 11633 CHARACTERS
AVGLRECL------------2334
MAXLRECL-----------11633
The TMP-MASTKEY is 14 bytes
The TMP-ALT-KEY is 17 bytes
Can you assure that the first 14 bytes of the altkey can be used for
direct access on the data component of the cluster, b.t.w. i didnt see
the AIX defintion in your listcat output. |
|
Back to top |
|
|
Ajay pai
New User
Joined: 24 Oct 2019 Posts: 1 Location: India
|
|
|
|
Thanks for above info. I had file status 93 as well and the job said waiting for deataset.
I tried open and close of online files a couple of time and did not show any result. However when i open and closed the alternate index along with the main file my issue got fixed. No more file status 93. 😊 |
|
Back to top |
|
|
|