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
 
COBOL vs COBOL/370 VSAM read using Alternate keys

 
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: Fri Feb 02, 2007 12:47 pm    Post subject: COBOL vs COBOL/370 VSAM read using Alternate keys
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

Site Director


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

PostPosted: Fri Feb 02, 2007 10:30 pm    Post subject:
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    Post subject: Re: COBOL vs COBOL/370 VSAM read using Alternate keys
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    Post subject: Re: COBOL vs COBOL/370 VSAM read using Alternate keys
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    Post subject: Re: COBOL vs COBOL/370 VSAM read using Alternate keys
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    Post subject: Re: COBOL vs COBOL/370 VSAM read using Alternate keys
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    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 ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am

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