Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
ALTERNATE RECORD KEY usage for KSDS AIX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sophia.lee

New User


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

PostPosted: Thu Jul 25, 2019 7:28 am    Post subject: ALTERNATE RECORD KEY usage for KSDS AIX
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: 8479
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 25, 2019 6:19 pm    Post subject: Reply to: ALTERNATE RECORD KEY usage for KSDS AIX
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    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 Concatenate two files of variable rec... Thiru S DFSORT/ICETOOL 3 Wed Aug 21, 2019 11:53 pm
No new posts FORMATTIME - CPU usage Nileshkul CICS 3 Sun Aug 18, 2019 5:22 am
This topic is locked: you cannot edit posts or make replies. Removing duplicate record based on th... Nilanjan Sikdar DFSORT/ICETOOL 4 Mon Jul 22, 2019 8:29 pm
No new posts Storage usage in a web service provider. John Poulakos CICS 0 Tue Jun 04, 2019 8:12 pm
No new posts DO we have alternate syntax for IFTHEN? useit Compuware & Other Tools 8 Wed May 29, 2019 3:50 pm

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