MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

File attribute mismatch error.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
pgorthi
Beginner


Joined: 13 Sep 2004
Posts: 33
Topics: 16

PostPosted: Thu Oct 21, 2004 3:55 am    Post subject: File attribute mismatch error. Reply with quote

Hi,

i am getting file attribute mismatch error why?. here i am attaching my ksds created jcl and cobol programe.

Using this jcl i created KSDS file:
Code:

 //ISCP02AT JOB (TTSOMFG0,OFF,1440,0050,0050),'PANI',MSGCLASS=X, 
 //             CLASS=1,NOTIFY=&SYSUID                           
 //DEFKSDS EXEC PGM=IDCAMS                                       
 //SYSPRINT  DD SYSOUT=*                                         
 //SYSIN     DD *                                                 
   DEFINE CLUSTER -                                               
     (NAME(ISCP02.VSAM.KSDS) -                                   
     CYLINDERS(1,1) -                                             
     KEYS(1,4) -                                                 
     RECORDSIZE(14,14) -                                         
     CONTROLINTERVALSIZE(4096)  -                                 
     FREESPACE(10,20))   -                                       
     DATA     -                                                   
     (NAME(ISCP02.VSAM.DATA))  -                                 
     INDEX   -                                                   
     (NAME(ISCP02.VSAM.INDEX) -                                   
     CONTROLINTERVALSIZE(4096))                                   
 /*                                                               
//

My COBOL programe is :
Code:

         IDENTIFICATION DIVISION.                       
         PROGRAM-ID. KSDSPGM.                           
         ENVIRONMENT DIVISION.                         
         CONFIGURATION SECTION.                         
         INPUT-OUTPUT SECTION.                         
         FILE-CONTROL.                                 
             SELECT AFILE ASSIGN TO KSDSDDNA           
             ORGANIZATION IS INDEXED                   
             ACCESS MODE IS RANDOM                     
             RECORD KEY IS A-NUM                       
             FILE STATUS IS ST-NAME.                   
         DATA DIVISION.                                 
         FILE SECTION.                                 
         FD AFILE.                                     
         01 A-REC.                                     
             05 A-NUM        PIC X(04).                 
           05 A-NAME       PIC A(10).                             
       WORKING-STORAGE SECTION.                                   
       01 ST-NAME          PIC X(02).                             
       01 NUM              PIC X(04) VALUE '1000'.               
       01 END-OF-FILE      PIC X(01) VALUE 'N'.                   
       PROCEDURE DIVISION.                                       
       1000-MAIN-PARA.                                           
           OPEN I-O AFILE.                                       
           DISPLAY 'ST-NAME:1*****' ST-NAME.                     
           PERFORM 2000-READ-PARA THRU 2000-READ-PARA-EXIT.       
           DISPLAY 'ST-NAME:2*****' ST-NAME.                     
           CLOSE AFILE.                                           
       1000-MAIN-PARA-EXIT.                                       
           EXIT.                                                 
       2000-READ-PARA.                                           
           MOVE NUM TO A-NUM.                                     
           MOVE 'PANI' TO A-NAME.                                 
           WRITE A-REC.                                           
               DISPLAY 'A-NUM:' A-NUM.             
               DISPLAY 'A-NAME:' A-NAME.           
        2000-READ-PARA-EXIT.                       
            EXIT.                                 
        2500-STOP-PARA.                           
            DISPLAY 'END OF THE FILE BYE...'.     
            STOP RUN.                             


my out put message is:
Code:

ST-NAME:1*****39               
A-NUM:1000                     
A-NAME:PANI                     
ST-NAME:2*****48               
A-NUM:1000                     
A-NAME:PANI                     
END OF THE FILE BYE...         


please help me why i am getting.

Regards,
pgorthi Embarassed Embarassed
Back to top
View user's profile Send private message AIM Address
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Oct 21, 2004 5:35 am    Post subject: Reply with quote

pgorthi,

A file status of 39 is usually caused due to a conflict has been detected between the fixed file attributes and the attributes specified for the file in the program.

This is usually caused by a conflict with record-length, key-length, key-position or file organization.

Other possible causes are:
1. Alternate indexes are incorrectly defined.
2. The Recording Mode is Variable or Fixed or not defined the same as when the file was created..

Now look at your KSDS definition. Especially the keys parameter

You specified keys( 1,4) which will create a key for a LENGTH of 1 and the Key position is from 4. But your cobol program shows that the key length is of 4 bytes and starts at pos 1

So you need to change the definition of keys (4, 0)

Since your input vsam cluster is a not initilized , it is a bad idea to open the file in I-o mode.

check this link which explains in detail about opening empty files.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3PG10/1.10.3.2.1?SHELF=&DT=20020923143836&CASE=

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
pgorthi
Beginner


Joined: 13 Sep 2004
Posts: 33
Topics: 16

PostPosted: Thu Oct 21, 2004 6:30 am    Post subject: Reply with quote

Hi Kolusu,

thanks a lot to kolusu. my programe working fine. greate help. bye,..

regards,
pgorthi
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group