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

ALTERNATE RECORD KEY usage for KSDS AIX


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

New User


Joined: 25 Jul 2019
Posts: 2
Location: Repulic of Korea

PostPosted: Thu Jul 25, 2019 7:28 am
Reply with quote

Hi, all.

I'm working on testing cobol compiler for Linux system(like MFCOBOL) as writing simple cobol program which reads and writes KSDS data.
I need to verify several cases where alternate key is defined on the dataset to identify exact specification of IBM cobol.
Could you help me to find out the expected result of Mainframe for the following cases?

case 1) In FILE CONTROL section, "ALTERNATE RECORD KEY IS WITH DUPLICATES" is specified.
1-1) create AIX with UNIQUEKEY attribute -> I think it would not be run correctly, but if READ/WRITE is performed for this kind of case, which is the expected result, return code of VSAM/cobol/JOB ?
1-2) create AIX with NONUNIQUEKEY attribute -> As far as I know, in this case VSAM file return code would be '02', please let me know if I'm wrong.

case 2) In FILE CONTROL section, "ALTERNATE RECORD KEY IS" (without duplicates) is specified.
2-1) create AIX with UNIQUEKEY attribute -> As far as I know, in this case VSAM file return code would be '22', please let me know if I'm wrong.
2-2) create AIX with NONUNIQUEKEY attribute -> I think it would not be run correctly, but if READ/WRITE is performed for this kind of case, which is the expected result, return code of VSAM/cobol/JOB ?

I couldn't find official manual description for these kinds of cases, so I'd like to ask your knowledge to find out real Mainframe's specification.
If there are any articles which describes the usage of AIX through cobol program, please let me know its link.
Furthermore, if you can have a simple test on Mainframe, I can give you the sample code for each case.

Thanks for your support.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Jul 25, 2019 6:19 pm
Reply with quote

I think your post suffers greatly from fuzzy thinking. You need to be clearer about what you're asking -- KSDS with alternate index can have READ / WRITE on primary key or alternate key (so you've got at least 4 different situations that you've squashed into 1).

Case 1-1: most likely the OPEN statement would get a file status '39' and any READ / WRITE statements would most likely get file status '47' or '48'
Case 1-2: are you reading with the primary key or the alternate key? For the primary key, you would not get a file status '02' reading nor writing
Case 2-1: file status '22' is only for WRITE / REWRITE
Case 2-2: OPEN would get a file status '39' and I/O statements should get a file status '47' or '48' (or even '49' if DELETE is attempted)
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 SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top