View previous topic :: View next topic
|
Author |
Message |
Lord.of.Wind
New User
Joined: 17 Nov 2005 Posts: 60
|
|
|
|
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 |
|
|
Mathiv Anan
Active User
Joined: 23 Jul 2008 Posts: 106 Location: USA
|
|
|
|
You are saying it is KSDS file.
Then, please change the assign statement as below.
Code: |
ASSIGN TO VSAM-ZIPCODE |
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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
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 |
|
|
Mathiv Anan
Active User
Joined: 23 Jul 2008 Posts: 106 Location: USA
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Mathiv Anan
Active User
Joined: 23 Jul 2008 Posts: 106 Location: USA
|
|
|
|
Thanks.
Crystal Clear |
|
Back to top |
|
|
Lord.of.Wind
New User
Joined: 17 Nov 2005 Posts: 60
|
|
|
|
Thanks.
Crystal Clear TOO! |
|
Back to top |
|
|
|