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

COBOL vs COBOL/370 VSAM read using Alternate keys


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Fri Feb 02, 2007 12:47 pm
Reply with quote

Hi,

The program reads a Vsam file whose layout in FD section is:

01 EXT-REC.
05 EXT-KEY.
10 EXT-ID PIC X(10).
10 EXT-SS1 PIC X(09).
10 EXT-CC PIC X(03).
10 EXT-OF-NUM PIC X(06).
10 EXT-NUM PIC X(08).
05 FILLER PIC X(35).
05 EXT-SS2 PIC X(09).

EXT-SS1, EXT-SS2 are alternate keys. EXT-KEY is the record key.

EXT-ID is alternate key only in COBOL version, we excluded it as alternate
key in COBOL /370 for sucessful compilation and appropriate code changes are subtituted in place of read using EXT-ID (Using Start and record key) This read is wroking fine.

When read is performed using EXT-SS1 as alternate key the record is found when the program is executed in COBOL version.
The record is not found for the same read and same test case if
the program executes in COBOL/370 version.

When the read is performed using EXT-SS2 the record is not found in
COBOL version execution. But the record is found in the COBOL/370
version execution.

In fact when the vsam file is opened in file aid using the above FD layout
data is spaces in EXT-SS2 and data is present in EXT-SS1.

Please suggest, so that the behaviour in both versions will be the same with out eliminating the READ using the alternate keys EXT-SS2 , EXT-SS1... If possible any

Note: The VSAM file has alternate indexes for EXT-ID ,EXT-SS1 , EXT-SS2
and also has Patha Entry Datasets for the 3 Alternate Indexes

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

Moderator Emeritus


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

PostPosted: Fri Feb 02, 2007 10:30 pm
Reply with quote

Hello,

Please post the DEFINEs for both of these files and their alternate indexes.
From the info you posted, you have different DEFINEs if they have different alternate key definitions.

Also, please run a compare in tso of the 2 programs and post the differences in the source code between the 2 programs.
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 Feb 05, 2007 11:41 am
Reply with quote

Hi,

The Vsam file definitions:

DELETE (KFC2.GLOB.VSB.LCP110V1) CLUSTER
DEFINE CLUSTER -
(NAME (KFC2.GLOB.VSB.LCP110V1) -
VOL (*) -
CYLINDERS (40 10) FOR (9999) KEYS (36 0) -
RECORDSIZE (80 80) CONTROLINTERVALSIZE (8192) -
SHAREOPTIONS (2) FREESPACE (30 30) SPEED) -
DATA -
(NAME (KFC2.GLOB.VSB.LCP110V1.DATA)) -
INDEX -
(NAME (KFC2.GLOB.VSB.LCP110V1.INDEX))


DEFINE ALTERNATEINDEX -
(NAME (KFC2.GLOB.VSB.LCP110A1) -
RELATE (KFC2.GLOB.VSB.LCP110V1) -
VOL (*) -
CYLINDERS (40 10) KEYS (10 0) -
RECORDSIZE (194 194) CONTROLINTERVALSIZE (8192) -
SHAREOPTIONS (2) SPEED NONUNIQUEKEY) -
DATA -
(NAME (KFC2.GLOB.VSB.LCP110A1.DATA)) -
INDEX -
(NAME (KFC2.GLOB.VSB.LCP110A1.INDEX))

DEFINE ALTERNATEINDEX -
(NAME (KFC2.GLOB.VSB.LCP110A2) -
RELATE (KFC2.GLOB.VSB.LCP110V1) -
VOL (*) -
CYLINDERS (40 10) KEYS (9 10) -
RECORDSIZE (194 194) CONTROLINTERVALSIZE (8192) -
SHAREOPTIONS (2) SPEED NONUNIQUEKEY) -
DATA -
(NAME (KFC2.GLOB.VSB.LCP110A2.DATA)) -
INDEX -
(NAME (KFC2.GLOB.VSB.LCP110A2.INDEX))

DEFINE ALTERNATEINDEX -
(NAME (KFC2.GLOB.VSB.LCP110A3) -
RELATE (KFC2.GLOB.VSB.LCP110V1) -
VOL (*) -
CYLINDERS (40 10) FOR (9999) KEYS (9 71) -
RECORDSIZE (194 194) CONTROLINTERVALSIZE (8192) -
SHAREOPTIONS (2) SPEED NONUNIQUEKEY) -
DATA -
(NAME (KFC2.GLOB.VSB.LCP110A3.DATA)) -
INDEX -
(NAME (KFC2.GLOB.VSB.LCP110A3.INDEX))

DEFINE PATH -
(NAME (KFC2.GLOB.VSB.LCP110P1) -
PATHENTRY (KFC2.GLOB.VSB.LCP110A1))
/***********************************************************/
DEFINE PATH -
(NAME (KFC2.GLOB.VSB.LCP110P2) -
PATHENTRY (KFC2.GLOB.VSB.LCP110A2))
/***********************************************************/
DEFINE PATH -
(NAME (KFC2.GLOB.VSB.LCP110P3) -
PATHENTRY (KFC2.GLOB.VSB.LCP110A3))

BLDINDEX INDATASET (KFC2.GLOB.VSB.LCP110V1) -
OUTDATASET (KFC2.GLOB.VSB.LCP110A1)
BLDINDEX INDATASET (KFC2.GLOB.VSB.LCP110V1) -
OUTDATASET (KFC2.GLOB.VSB.LCP110A2)
BLDINDEX INDATASET (KFC2.GLOB.VSB.LCP110V1) -
OUTDATASET (KFC2.GLOB.VSB.LCP110A3)
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 Feb 05, 2007 11:47 am
Reply with quote

Hi ,
One more observation is when i compile COBOL/370 code changes with
COBOL compiler and execute the program i get file status '95' when the program opens the VSAM file.

regards,
Sasi Patha.
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 Feb 05, 2007 12:01 pm
Reply with quote

here are the code enhancements:

I - *V.FCM1020256 CHANGES START
I - 001360* ALTERNATE RECORD KEY IS AP-ZB-CUST-ID OF AP-ZB-KEY
I - 001370* WITH DUPLICATES
I - *V.FCM1020256 CHANGES ENDS
D - 001360 ALTERNATE RECORD KEY IS AP-ZB-CUST-ID OF AP-ZB-KEY
D - 001370 WITH DUPLICATES


I - *TEST
I - 05 WS-FIRST-TIME-SW PIC X(01) VALUE 'Y'.
I - 88 FIRST-TIME VALUE 'Y'.
I - 88 NEXT-TIME VALUE 'N'.
I - *TEST

I - *TEST
I - 01 WS-SALES-DOWNLOAD-REC PIC X(80) VALUE SPA
I - *TEST

I - 003580 IF AP-ZB-FILE-STATUS = GD-AN-00 OR GD-AN-97
I - *V.FCM1020195 CHANGES ENDS.
D - 003580 IF AP-ZB-FILE-STATUS = GD-AN-00

I - 003810 IF AP-ZB-FILE-STATUS = GD-AN-00 OR GD-AN-97
D - 003810 IF AP-ZB-FILE-STATUS = GD-AN-00

I - START AP-ZB-EXTRACT-FILE
I - KEY >= AP-ZB-KEY.
I -
I - IF (AP-ZB-FILE-STATUS = GD-AN-00)
I - 004360 READ AP-ZB-EXTRACT-FILE NEXT RECORD
I - INTO SALES-DOWNLOAD-REC.
I - 004370* KEY IS AP-ZB-CUST-ID.
I - *V.FCM1020256 CHANGES ENDS.
D - 004360 READ AP-ZB-EXTRACT-FILE INTO SALES-DOWNLOAD-REC
D - 004370 KEY IS AP-ZB-CUST-ID.

Please refer the FD in the 1st communication.
ID is the cust id .
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 Feb 05, 2007 3:48 pm
Reply with quote

Hi all,

Thank you for patience and timely response.

The issue is resolved. The VSAM file is defined with out the
CUST-ID as alternate index and removed the correponding Path entry data set in the JCL for the program.

Thank You,
Sasi Patha. :-)
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Error to read log with rexx CLIST & REXX 11
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top