View previous topic :: View next topic
|
Author |
Message |
rukmakiran
New User
Joined: 19 Apr 2005 Posts: 21
|
|
|
|
Hi ,
As I read in VSAM AIX - Alternate index Query.,
i am facing the same error file status 39 when i try to access the VSAM file contains the AIX & PATH, even though the description of FD & File section for the file represents the same file length ,Can any one guide me on this
JCL:
Code: |
//S020.DDIN2@ DD DSN=T.GAPNWTVX.DW.ACCTLIST.CFSUNGR.PATH1,DISP=SHR
//S020.DDIN21 DD SUBSYS=(BLSR,' DDNAME=DDIN2@','MSG=I',
// 'BUFNI=50','BUFND=50','DEFERW=NO')
//S020.DDIN2 DD DSN=T.GAPNWTVX.DW.ACCTLIST.CFSUNGR,DISP=SHR
COBOL:
SELECT CFSUNGR-FILE ASSIGN TO DDIN2
ACCESS DYNAMIC
ORGANIZATION INDEXED
RECORD KEY CFSUNGR-PRIME-KEY
ALTERNATE KEY CFSUNGR-ALT-KEY-4
FILE STATUS WS-CFSUNGR-STATUS.
FD CFSUNGR-FILE.
COPY CFSUNGR. |
Appreciate if anyone can look into and let me know what waswrong in it?
thanks. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
Quote: |
Appreciate if anyone can look into |
With so little posted, there is little anyone can "look into".
It may help if you post the idcams step(s) that created the vsam files.
Also, post the length of the fd from the program.
If more is needed, we can go from there. |
|
Back to top |
|
|
rukmakiran
New User
Joined: 19 Apr 2005 Posts: 21
|
|
|
|
Hey dick , thanks for reply ...
There are no changes in the existing file layout and also the program structure , i did compiled the program once & then onwards could not run the program successfully by getting the file open error 39 even the file length 250 FB & the copybook structure is of with 250 bytes...
Where as i can tell you the program was running is of the compiled version as of 2001.
I felt there might be some changes in the compatible for cobol program which i am not able to , so i need help on understanding what could be the difference in coding which was allowed by compiles as of 2001 & not currently
if you want it I can get the lengths of the file & copybook structure from Fileaid.
Thans. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
if you want it I can get the lengths of the file & copybook structure from Fileaid. |
Yes, that may help.
It would also be good to see the delete/define for this. . .
Quote: |
so i need help on understanding what could be the difference in coding which was allowed by compiles as of 2001 & not currently |
You would need to find out the version of the compiler used in 2001 (AMBLIST may show this if run against an old load module). Then would be the investigation of the "differences" between that compiler and the one currently in use.
I believe this will be resolved more quickly by just working with the current code and compiler. . . |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
There are no changes in the existing file layout and also the program structure |
So why is a program recompile required?
Your first step should be to do a LISTCAT on the base cluster and the alternate index, then compare the key information and record length in the LISTCAT output against your program definition of CFSUNGR-FILE.
There hasn't been enough change in the COBOL compilers from 2001 to now to cause any kind of VSAM problem that I'm aware of -- although it is possible that an option default (or override) was changed that impacted the file. You need to check the compiler options to see if any of them could have an impact (such as CODEPAGE). |
|
Back to top |
|
|
rukmakiran
New User
Joined: 19 Apr 2005 Posts: 21
|
|
|
|
Done LISTCAT & observed the file lengths used for file & in JOb for cluster & AIX are same.
Not sure how i can check the CODEPAGE if i am using the CHANEMAN for compilation. Please suggest if any other options i can check
Thanks, |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
Done LISTCAT & observed the file lengths used for file & in JOb for cluster & AIX are same. |
Since this is about half of what you were asked, I doubt you've successfully done this -- especially since it is not clear what you mean by "file length" (total length of the file? length of one record? length of the file key? length of the file alternate index key? length of the alternate index record? something else you haven't explained?)
The LISTCAT will have an offset and length for the primary key of the base cluster. Do these match (after adding 1 to the offset) the key position and length in the program for the primary key? If the average and maximum record lengths in the LISTCAT are the same, does the program indicate the file is fixed length and each 01 in the FD for the file matches this length? If the average and maximum record lengths in the LISTCAT are different, does the program indicate the file is variable length and none of the 01 entries in the FD for the file exceed the maximum length in the LISTCAT?
The LISTCAT will have an offset and length for each alternate index key. Do these match (after adding 1 to the offset) the position and length of the alternate index keys in the program? (Actually from the JCL and code you posted earlier, it appears you only have one altternate index.) Note that the alternate index record length is not referenced nor needed in the COBOL program, so you cannot match the LISTCAT output for it to your program. |
|
Back to top |
|
|
rukmakiran
New User
Joined: 19 Apr 2005 Posts: 21
|
|
|
|
Here are the details ,please review...
Code: |
Cluster:
----------
DATA ---------- T.GAPNWTVX.DW.ACCTLIST.CFSUNGR.DATA
IN-CAT --- CATALOG.DEVXI2
HISTORY
DATASET-OWNER-----(NULL) CREATION--------2009.293
RELEASE----------------2 EXPIRATION------0000.000
ACCOUNT-INFO-----------------------------------(NULL)
PROTECTION-PSWD-----(NULL) RACF----------------(NO)
ASSOCIATIONS
CLUSTER--T.GAPNWTVX.DW.ACCTLIST.CFSUNGR
ATTRIBUTES
KEYLEN----------------26 AVGLRECL-------------250
RKP--------------------0 MAXLRECL-------------250
STRIPE-COUNT-----------1
SHROPTNS(2,3) SPEED UNIQUE NOERASE
UNORDERED NOREUSE NONSPANNED EXTENDED
INDEX --------- T.GAPNWTVX.DW.ACCTLIST.CFSUNGR.INDEX
IN-CAT --- CATALOG.DEVXI2
HISTORY
DATASET-OWNER-----(NULL) CREATION--------2009.293
RELEASE----------------2 EXPIRATION------0000.000
PROTECTION-PSWD-----(NULL) RACF----------------(NO)
ASSOCIATIONS
CLUSTER--T.GAPNWTVX.DW.ACCTLIST.CFSUNGR
ATTRIBUTES
KEYLEN----------------26 AVGLRECL---------------0
RKP--------------------0 MAXLRECL------------2553
SHROPTNS(2,3) SPEED UNIQUE NOERASE
NOREUSE EXTENDED EXT-ADDR
STATISTICS
REC-TOTAL--------------1 SPLITS-CI--------------0
DATA ---------- T.GAPNWTVX.DW.ACCTLIST.CFSUNGR.IDX1.DATA
IN-CAT --- CATALOG.DEVXI2
HISTORY
DATASET-OWNER-----(NULL) CREATION--------2009.293
RELEASE----------------2 EXPIRATION------0000.000
ACCOUNT-INFO-----------------------------------(NULL)
PROTECTION-PSWD-----(NULL) RACF----------------(NO)
ASSOCIATIONS
AIX------T.GAPNWTVX.DW.ACCTLIST.CFSUNGR.IDX1
ATTRIBUTES
KEYLEN----------------13 AVGLRECL--------------44
RKP--------------------5 MAXLRECL--------------44
AXRKP----------------118
SHROPTNS(2,3) SPEED UNIQUE NOERASE
UNORDERED NOREUSE SPANNED NONUNIQKEY
STATISTICS
REC-TOTAL-----------1412 SPLITS-CI--------------0
REC-DELETED------------0 SPLITS-CA--------------0 |
Code: |
Copybook:
--------- FIELD LEVEL/NAME ---------- -PICTURE- -NUMBER START END LENGTH
CFSUNGR-RECORD 1 250 250 |
Code: |
alternate key :
5 CFSUNGR-ALT-KEY-4 GROUP 47 130 142 13
10 CFSUNGR-SK-ACCT-NBR-ALT4 |
Code: |
CObol program :
SELECT CFSUNGR-FILE ASSIGN TO DDIN2
ACCESS DYNAMIC
ORGANIZATION INDEXED
RECORD KEY CFSUNGR-PRIME-KEY
ALTERNATE KEY CFSUNGR-ALT-KEY-4
FD CFSUNGR-FILE.
COPY CFSUNGR. |
Code: |
JCL :
//S020.DDIN2@ DD DSN=T.GAPNWTVX.DW.ACCTLIST.CFSUNGR.PATH1,DISP=SHR
//S020.DDIN21 DD SUBSYS=(BLSR,' DDNAME=DDIN2@','MSG=I',
// 'BUFNI=50','BUFND=50','DEFERW=NO')
//S020.DDIN2 DD DSN=T.GAPNWTVX.DW.ACCTLIST.CFSUNGR,DISP=SHR |
Code'd |
|
Back to top |
|
|
rukmakiran
New User
Joined: 19 Apr 2005 Posts: 21
|
|
|
|
Also i just want to know how the path supports to cluster in JCL & use of SUBSYS ..
//S020.DDIN2@ DD DSN=T.GAPNWTVX.DW.ACCTLIST.CFSUNGR.PATH1,DISP=SHR,
// DCB=(LRECL=44,BLKSIZE=0,RECFM=FB,BUFNO=20)
//S020.DDIN21 DD SUBSYS=(BLSR,' DDNAME=DDIN2@','MSG=I',
// 'BUFNI=50','BUFND=50','DEFERW=NO') [/img] |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
The LISTCAT output says your alternate index starts in byte 119 of the record for 13 bytes (AXRKP) whereas the COBOL program says it starts in byte 130 for 13 bytes. This will cause the file status 39.
As an observation, your alternate index makes no sense. It specifies NONUNIQUEKEY which means duplicates are allowed. However, the record size is 44 bytes -- 5 bytes overhead plus 26 bytes primary key plus 13 bytes alternate key is 44 bytes. So you cannot have duplicates -- even though the LISTCAT says there can be.
rukmakiran: BLSR uses an extra DD name like this; DDIN21 points to DDIN2@ and between the two of them the parameters are complete. |
|
Back to top |
|
|
rukmakiran
New User
Joined: 19 Apr 2005 Posts: 21
|
|
|
|
I have done changes as per your suggession in COPYBOOK structure with out distrubbing the lengh of the copybook and also in the program.
Copy strucure
FIELD
--------- FIELD LEVEL/NAME ---------- -PICTURE- -NUMBER START END LENGTH
CFSUNGR-RECORD 1 250 250
--------- FIELD LEVEL/NAME ---------- -PICTURE- -NUMBER START END LENGTH
5 CFSUNGR-ALT-KEY-4 GROUP 42 119 131 13
10 CFSUNGR-SK-ACCT-NBR-ALT4
X(12) 43 119 130 12
10 CFSUNGR-SK-STATUS-ALT4 X 44 131 131 1
program:
SELECT CFSUNGR-FILE ASSIGN TO DDIN2
ACCESS DYNAMIC
ORGANIZATION INDEXED
RECORD KEY CFSUNGR-PRIME-KEY
ALTERNATE KEY CFSUNGR-ALT-KEY-4
WITH DUPLICATES
FILE STATUS WS-CFSUNGR-STATUS.
But getting the same error, anything else missing here, please suggest..
Thanks, |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Since you changed both the file layout to get the alternate key in the right spot in the COBOL program AND added WITH DUPLICATES to your code, try taking out the WITH DUPLICATES phrase -- especially since you've been told that your alternate index, as it existed when you posted the output, cannot have any duplicates.
If you continue to get the error after taking out the WITH DUPLICATES, contact your site support group and have them help you. They have access to more information, quicker, than you are providing piecemeal to us and should be able to isolate the cause that much faster. |
|
Back to top |
|
|
rukmakiran
New User
Joined: 19 Apr 2005 Posts: 21
|
|
|
|
Thanks for Quick reply, wouldn't work even after taking off the "WITH DUPLICATES CLAUSE.
Last question - can you suggest ,will there be any changes required in OPEN statement or definition of the status listed below:
05 WS-CFSUNGR-STATUS PIC X(02) VALUE '00'.
88 WS-CFSUNGR-NORMAL-I-O VALUE '00'.
88 WS-CFSUNGR-NOTFND VALUE '23'.
88 WS-CFSUNGR-NORMAL-OPEN VALUE '00' '97'.
OPEN INPUT APFILE-FILE
CFSUNGR-FILE
IF WS-CFSUNGR-NORMAL-OPEN
SET WS-CFSUNGR-OPENED
TO TRUE
DISPLAY WS-FILE-PGM ': I/P DDIN2 FILE OPENED'
ELSE
MOVE 'DDIN2' TO WS-FILE-NAME
MOVE 'OPEN' TO WS-FILE-COMMAND
MOVE WS-CFSUNGR-STATUS
TO WS-FILE-STATUS
MOVE 'A110' TO WS-FILE-PARAGRAPH
PERFORM A111-DISPLAY-FILE-MSG
THRU A111-EXIT
END-IF
A111-DISPLAY-FILE-MSG.
DISPLAY ' '
DISPLAY WS-FILE-MSG
DISPLAY WS-FILE-MSG UPON CONSOLE
DISPLAY ' '
SET WS-NOT-OK TO TRUE.
Thanks. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Nope -- an OPEN statement is an OPEN statement is an OPEN statement. You would rarely, if ever, have to change an OPEN statement when something about the file changes. The OPEN is ensuring the file matches the characteristics your program specified and that you can access it in the way you want. |
|
Back to top |
|
|
rukmakiran
New User
Joined: 19 Apr 2005 Posts: 21
|
|
|
|
Thanks .. Will check with our operations.... |
|
Back to top |
|
|
|