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

A Very weird compiling error for VSAM file-control


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Lord.of.Wind

New User


Joined: 17 Nov 2005
Posts: 60

PostPosted: Thu Jul 09, 2009 3:34 pm
Reply with quote

Code:

FILE-CONTROL
      SELECT ZIPCODE-FILE                     
       ASSIGN TO UT-S-ZIPCODE           
       ORGANIZATION IS INDEXED           
       ACCESS MODE IS RANDOM             
       RECORD KEY  IS ZIPCODE           
       FILE STATUS IS WS-ZIPTABLE-STATUS.
 


I have created a KSDS use the following code:

DEFINE CLUSTER (NAME('ZIPSITE.ZIPTABLE') -
KEYS(5 0)-
TRACKS(10 10)-
RECSZ(5 5))-
DATA (NAME('ZIPSITE.ZIPTABLE.DATA')) -
INDEX (NAME('ZIPSITE.ZIPTABLE.INDEX') )

Here is the error compiling msg:
Code:

E-The "ORGANIZATION" clause for file "ZIPCODE-FILE" specified an organization that was different from the organization specified in the assignment-name.  An organization of "INDEXED" was assumed.

S-A "RECORD KEY" clause was missing or invalid in the "SELECT" entry for file "ZIPCODE-FILE".  The file definition was discarded.

S-"RECORD KEY" or "ALTERNATE RECORD KEY" "ZIPCODE" was not
defined within a logica "ZIPCODE-FILE".  The key was discarded.

The "LABEL" clause was processed as comments for this file definition.         
                                                                               
The "BLOCK CONTAINS" clause was processed as comments for this file definition.
                                                                               
A "RECORDING MODE" clause was found for a file that did not have physical "SEQUENTIAL" organization.  The "RECORDING MODE" clause was discarded.


Sincerely holp somebody can help me out.[/code]
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Thu Jul 09, 2009 3:41 pm
Reply with quote

You are saying it is KSDS file.

Then, please change the assign statement as below.

Code:
ASSIGN TO VSAM-ZIPCODE
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 09, 2009 4:55 pm
Reply with quote

The COBOL Language Reference manual, at the manuals link at the top of the page, explicitly states that UT-S-ddname will be a sequential file. If you had said
Code:
       ASSIGN TO UT-ZIPCODE 
or even
Code:
       ASSIGN TO ZIPCODE 
that would have been fine.

Some of the error messages you posted reference the FD clause in the FILE SECTION, yet you did not post it. Psychic day is not today, so we cannot give you any help on data you did not post.
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Thu Jul 09, 2009 5:55 pm
Reply with quote

Robert,

I thought 'VSAM-' or even without that will be correct one in above FD.

Can you correct me if something wrong.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 09, 2009 6:01 pm
Reply with quote

There are only three requirements for an ASSIGN:
1. The DDNAME is required.
2. If the file is sequential VSAM (ESDS), you must have AS-ddname (with an optional label- in front of the AS).
3. If the format is label-S-ddname, COBOL expects the file to be QSAM sequential and will have problems if the file is not QSAM sequential. The label- is also optional.

Your VSAM- is considered a label and is optional in all cases. You could even have VSAM-S-DDNAME which would assign DDNAME to a QSAM sequential file -- the VSAM- is not used by COBOL. You're not really wrong by putting it, but you're not providing COBOL anything it will use.
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Thu Jul 09, 2009 6:12 pm
Reply with quote

Thanks.

Crystal Clear icon_smile.gif
Back to top
View user's profile Send private message
Lord.of.Wind

New User


Joined: 17 Nov 2005
Posts: 60

PostPosted: Fri Jul 10, 2009 7:29 am
Reply with quote

Thanks.

Crystal Clear TOO! icon_biggrin.gif
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Error when install DB2 DB2 2
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top