Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Alternate Record key error (VS COBOL 2 COBOL 370 conversion)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Mon Dec 11, 2006 4:55 pm    Post subject: Alternate Record key error (VS COBOL 2 COBOL 370 conversion)
Reply with quote

Hi,
I have a requirement for converting a COBOL program to COBOL370 program.

Error Description:
----------------------

"ALTERNATE RECORD KEY" "AP-ZB-CUST-ID" had the same leftmost character position as that of the "RECORD KEY" for this file. The "ALTERNATE RECORD KEY" was discarded.
&
"KEY" data-name "AP-ZB-CUST-ID (ALPHANUMERIC)" was not defined as a "RECORD KEY" , "ALTERNATE RECORD KEY" or "RELATIVE KEY" for VSAM file "AP-ZB-EXTRACT-FILE". The statement was discarded.


COBOL syntax of Alternate record key :
---------------------------------------------


SELECT AP-ZB-EXTRACT-FILE ASSIGN TO VSAMG-APZBIN
ACCESS MODE IS DYNAMIC
ORGANIZATION IS INDEXED
RECORD KEY IS AP-ZB-KEY
ALTERNATE RECORD KEY IS AP-ZB-CUST-ID OF AP-ZB-KEY
WITH DUPLICATES
ALTERNATE RECORD KEY IS AP-ZB-NM1-SS OF AP-ZB-KEY
WITH DUPLICATES
ALTERNATE RECORD KEY IS AP-ZB-NM2-SS OF AP-ZB-EXTRACT-REC
WITH DUPLICATES
FILE STATUS IS AP-ZB-FILE-STATUS.


FD AP-ZB-EXTRACT-FILE
LABEL RECORDS ARE STANDARD
* BLOCK CONTAINS 0 RECORDS
* RECORD CONTAINS 80 CHARACTERS
DATA RECORD IS AP-ZB-EXTRACT-REC.

01 AP-ZB-EXTRACT-REC.
05 AP-ZB-KEY.
10 AP-ZB-CUST-ID PIC X(10).
10 AP-ZB-NM1-SS PIC X(09).
10 AP-ZB-COMP-CODE PIC X(03).
10 AP-ZB-OFF-NUM PIC X(06).
10 AP-ZB-CONTRACT-NUM.
15 AP-ZB-ACCT-NUM PIC X(06).
15 AP-ZB-CYCLE-DT PIC X(02).
05 FILLER PIC X(35).
05 AP-ZB-NM2-SS PIC X(09).

Please suggest any Approach... I tried removing the "OF" qualifier. I tried using redefines. Neither worked. The alternate record key data items are not declared anywhere else in the program.

Regards,
Sasi patha
Back to top
View user's profile Send private message

cynderilla

New User


Joined: 07 Dec 2006
Posts: 5
Location: chennai

PostPosted: Mon Dec 11, 2006 5:47 pm    Post subject: Alternate Record key error (VS COBOL 2 COBOL 370 conversion)
Reply with quote

Hi Kiran,

Can u please be more specific to the problem,

i think we cannot define the same key or a part of the key which
was already defined as record key as alternate record key.

correct me if i am wrong.
Back to top
View user's profile Send private message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Mon Dec 11, 2006 5:59 pm    Post subject: Re: Alternate Record key error (VS COBOL 2 COBOL 370 convers
Reply with quote

hi,
Defining alternate record key as part of Record Key is valid. The program
executes fine in its COBOL version.
Problem is the compilation error in its COBOL370 version.

Thanks,
Sasi Patha.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Dec 11, 2006 6:09 pm    Post subject:
Reply with quote

The second error is a result of the first.
The first error is probably your friendly neighborhood compiler doing some commen sense optimizing; The alt key starting at the same character as the pri key is useless, just delete the useless key and recode procedure references to the pri key.
Back to top
View user's profile Send private message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Tue Dec 12, 2006 9:52 am    Post subject: Re: Alternate Record key error (VS COBOL 2 COBOL 370 convers
Reply with quote

Hi, Good morning icon_smile.gif . Thanks for the reply. I have some concerns:

Alternate Key definitely starts at the same character as the primary Key
but not of same length as primary Key. The alternate keys in the program are all part of the Record key.

Reading the file using any of the alternate Record key
Fetches multiple records in the current scenario in the Procedure Division.

If we Change the references to Pri Key in the procedure division,
what will be the FILE STATUS after the READ statement executes.
Will there be a chance for program abend because of multiple records fetched, when the pri key is supposed to fetch a single record.

Even if it works,the defined alternate indices will be obsolete. How does it affect the performance.

Regards,
Sasi Patha.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Dec 12, 2006 3:23 pm    Post subject:
Reply with quote

Where the bad key is used, the read needs to use the pri key with lv in the unused fields, checking for key change in the interested portion.

A little logic change......
Back to top
View user's profile Send private message
Manicka Yazhini T

New User


Joined: 01 Jun 2011
Posts: 7
Location: INDIA

PostPosted: Mon Jun 06, 2011 2:44 pm    Post subject:
Reply with quote

Quote:
Where the bad key is used, the read needs to use the pri key with lv in the unused fields, checking for key change in the interested portion.

A little logic change......



William,

Could you please be more specific to this post? I have the same requirement now to use AIX KEY starting at the left most position of the RECORD KEY. But COBOL compliler do not accept it? What Can I do?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Jun 06, 2011 2:52 pm    Post subject:
Reply with quote

William has not posted anything since July last year.

Why don't you start a new topic, with your specific requirement more explicitly stated. Tell us what you want to do, what you have tried, how it failed. Stating that the "compiler do not accept it" is no use, what was the message, did you look it up to see what it means?

Congratulations, by the way, in actually searching the forum first. Doesn't often seem to happen.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jun 06, 2011 3:00 pm    Post subject:
Reply with quote

Hello,

Quote:
William has not posted anything since July last year.

And this topic has been inactive for 4.5 years. . .

Please start a new topic for your question posting the diagnostic information generated when you tried to compile.

Quote:
But COBOL compliler do not accept it?
Another version of "it didn't work" - which is is the least productive bit of info that can be posted. We accept that "something" didn't work, but the poster needs to provide the specific information as to what error(s) were generated.
Back to top
View user's profile Send private message
Manicka Yazhini T

New User


Joined: 01 Jun 2011
Posts: 7
Location: INDIA

PostPosted: Mon Jun 06, 2011 3:06 pm    Post subject: Reply to: Alternate Record key error (VS COBOL 2 COBOL 370 c
Reply with quote

OK I shall do.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Format Last Record differently from r... Learncoholic DFSORT/ICETOOL 0 Tue Oct 24, 2017 12:01 pm
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us