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
 
[Solved]Prbolem while reading through Alternate index

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

New User


Joined: 08 Aug 2005
Posts: 27
Location: USA

PostPosted: Mon Sep 19, 2005 7:23 pm    Post subject: Prbolem while reading through Alternate index
Reply with quote

My prob is I read all empl file record then whose empl-sal is greather than 10,000 only those record will go into out put.
SELECT EMPL-FILE ASSIGN TO IDDNAM1
ORGANIZATION IS INDEXED
ACCESS IS SEQUENTIAL
RECORD KEY IS EMPL-ID
STATUS IS EMPL-STAT.
SELECT DEPT-FILE ASSIGN TO IDDNAM2
ORGANIZATION IS INDEXED
ACCESS IS RANDOM
RECORD KEY IS DEPT-NO
ALTERNATE RECORD KEY IS DEPT-EMPID
WITH DUPLICATES
STATUS IS DEPT-STAT.

FD EMPL-FILE.
01 EMPL-FILE-REC.
05 EMPL-ID PIC 9(06).
05 EMPL-NAME PIC X(20).
05 EMPL-DOB PIC 9(08).
05 EMPL-SAL PIC 9(8)V99.


FD DEPT-FILE.
01 DEPT-FILE-REC.
05 DEPT-NO PIC 9(06).
05 DEPT-NAME PIC X(10).
05 DEPT-LOC PIC X(10).
05 DEPT-EMPID PIC 9(6). ( Alternate index )

Out put should look like this
DEPERTMENT NAME EMPLOYEE ID EMPLOYEE NAME SALARY
Kolkata 111111 SUMANTA SOREN 11111111.11
Kolkata 333333 JOHN MATHEWS 33333333.33
Delhi 444444 PAUL RICHARD 44444444.44

but giving as
DEPERTMENT NAME EMPLOYEE ID EMPLOYEE NAME SALARY
0 111111 SUMANTA SOREN 11111111.11
0 333333 JOHN MATHEWS 33333333.33
0 444444 PAUL RICHARD 44444444.44


I am reading dept file as
MOVE EMPL-ID TO DEPT-EMPID
IF WS-EMPL-EXISTS = 'Y'
READ DEPT-FILE KEY IS DEPT-EMPID
INVALID KEY
DISPLAY ' DEPT STATUS :' DEPT-STAT
END-READ
END-IF.

I have included in jcl
//IDDNAM1 DD DSN=U122949.VSAM.EMPL,
// DISP=SHR
//IDDNAM2 DD DSN=U122949.VSAM.DEPT,
// DISP=SHR
//IDDNAM21 DD DSN=U122949.VSAM.DEPT.AIX.PATH,
// DISP=SHR



In spool it gives
DEPT STATUS :23
DEPT ID :



EMPL-FILE :
111111SUMANTA SOREN 080219811111111111
222222SUSANTA PAL 101019800000002222
333333JOHN MATHEWS 210319803333333333
444444PAUL RICHARD 170719794444444444

DEPT-FILE :
555555merket kolkata 111111
666666insurence kolkata 222222
777777pension delhi 444444
Back to top
View user's profile Send private message

gigs

New User


Joined: 08 Aug 2005
Posts: 27
Location: USA

PostPosted: Wed Sep 21, 2005 4:19 pm    Post subject: Re: Prbolem while reading through Alternate index
Reply with quote

I have solve the problem


I have wrongly define the alternatekey cluster
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 Confusion b/w index and subscript Deepak kumar25 Mainframe Interview Questions 7 Thu Aug 31, 2017 6:50 am
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts Need help in reading and validating a... ABINAYATHULASI COBOL Programming 8 Tue Apr 18, 2017 11:42 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm

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