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

VSAM file error while rewriting


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Paul1983

New User


Joined: 08 Jul 2008
Posts: 37
Location: bangy

PostPosted: Thu Aug 21, 2008 2:19 pm
Reply with quote

Hi,

I'm trying to rewrite a KSDS file with following attributes

File Type: KSDS
CI Size: 512
Key length: 12
Key location: 0
Record format: V
Average record length: 229
Maximum record length: 229

the FILE-CONTROL is as follows

SELECT PU1100-UPFILE ASSIGN UT19
ORGANIZATION IS INDEXED
ACCESS IS DYNAMIC
RECORD DPU-KEY
FILE STATUS IS W120-FILE-STATUS.

where DPU-KEY = X(12)

FD PU1100-UPFILE
BLOCK CONTAINS 0 RECORDS
LABEL RECORDS ARE STANDARD.
01 DPU1100-UPFILE-REC PIC X(229).


OPEN I-O PU1100-UPFILE.


MOVE SPACES TO DPU-KEY.
START PU1100-UPFILE KEY GREATER THAN DPU-KEY.
READ 1100-UPFILE.


The above are the details of my program.But I'm getting compilation error as follows

A "RECORD KEY" CLAUSE WAS MISSING OR INVALID IN THE "SELECT" ENTRY FOR FILE "PU1100-UPFILE".


"RECORD KEY" OR "ALTERNATE RECORD KEY" "DPU-KEY" WAS NOT DEFINED WITHIN A LOGICAL RECORD OF FILE "PU1100-UPFILE". THE KEY WAS DISCARDED.

AN ERROR WAS FOUND IN THE DEFINITION OF FILE "PU1100-UPFILE".


Please help in resolving this error


Thanks,
Paul
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Aug 21, 2008 2:41 pm
Reply with quote

RECORD DPU-KEY

that is not a record key clause, that is a record clause.
Back to top
View user's profile Send private message
Paul1983

New User


Joined: 08 Jul 2008
Posts: 37
Location: bangy

PostPosted: Thu Aug 21, 2008 2:54 pm
Reply with quote

I changed as follows

SELECT PU1100-UPFILE ASSIGN UT19
ORGANIZATION IS INDEXED
RECORD KEY DPU-KEY
ACCESS IS DYNAMIC
FILE STATUS IS W120-FILE-STATUS.


Still it's giving same error

Thanks,
Paul
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Aug 21, 2008 3:16 pm
Reply with quote

Paul,
Quote:

WAS NOT DEFINED WITHIN A LOGICAL RECORD OF FILE

and this is your logical record

01 DPU1100-UPFILE-REC PIC X(229).
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Thu Aug 21, 2008 4:00 pm
Reply with quote

DPU-KEY should be declared as a part of record structure. In your case 01 DPU1100-UPFILE-REC PIC X(229) does not show DPU-KEY.
Make it as below-
Code:
01 DPU1100-UPFILE-REC.
   05 DPU-KEY PIC X(12).
   05 filler      PIC X(217).

Let us know if it works.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top