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
 
JCL for reading a record from an alternate index file

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

New User


Joined: 22 Aug 2007
Posts: 5
Location: Pune

PostPosted: Wed Aug 29, 2007 12:01 pm    Post subject: JCL for reading a record from an alternate index file
Reply with quote

Please anyone send me the jcl for reading a record from an alternate index file.i have written a jcl and if i run it i am getting maxcc=0 but file status code is 35.

Warning: Title Edited
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: Wed Aug 29, 2007 1:08 pm    Post subject:
Reply with quote

Hello,

If you post your jcl, sample data, and what you need for output, someone may be able to offer suggestions.
Back to top
View user's profile Send private message
kanth_das

New User


Joined: 22 Aug 2007
Posts: 5
Location: Pune

PostPosted: Wed Aug 29, 2007 1:25 pm    Post subject: Reply to: JCL for reading a record from an alternate index f
Reply with quote

THIS IS MY JCL
Code:
//BOYSD2S JOB ,SRIKANTH,CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=BOYSD2
//STEP1 EXEC PROC=IGYWCLG                                             
//COBOL.SYSIN DD DSN=BOYSD2.JCL.PDS1(ALTINDX),DISP=SHR                 
//GO.CPBSYS DD DSN=BOYSD2.VSAM.ALTIND,DISP=SHR                         
//DD2 DD DSN=BOYSD2.VSAM.PATHIND,DISP=SHR                             
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT DD SYSOUT=*                                                   
//SYSIN DD *                                                           
CHENNAI                                                               
/*                                                                     
//
THIS IS MY COBOL PROGRAM
Code:
IDENTIFICATION DIVISION.                                     
PROGRAM-ID.    ALTINDX.                                     
ENVIRONMENT DIVISION.                                       
CONFIGURATION SECTION.                                       
SOURCE-COMPUTER.              IBM-3090.                     
OBJECT-COMPUTER.              IBM-3090.                     
INPUT-OUTPUT SECTION.                                       
FILE-CONTROL.                                               
    SELECT ALTINDEX-DETAILS-FILE ASSIGN TO CPBSYS           
           ACCESS IS DYNAMIC                                 
           ORGANIZATION IS INDEXED                           
           RECORD KEY IS CPSYS-01-KEY                       
           ALTERNATE KEY IS CPSYS-01-LOCATION WITH DUPLICATES
           FILE STATUS IS WS-CPBALT-STATUS.                 
DATA DIVISION.                                               
FILE SECTION.                                               
FD ALTINDEX-DETAILS-FILE.                                   
01 WS-EMPLOYEE-RECORD.                                       
    03 CPSYS-01-KEY PIC X(6).
    03 FILLER PIC X(1).             
    03 CPSYS-01-NAME PIC X(12).     
    03 FILLER PIC X(1).             
    03 CPSYS-01-DOB PIC X(10).       
    03 FILLER PIC X(1).             
    03 CPSYS-01-DSGN PIC X(17).     
    03 FILLER PIC X(1).             
    03 CPSYS-01-DEPT PIC X(13).     
    03 FILLER PIC X(1).             
    03 CPSYS-01-LOCATION PIC X(8).   
    03 FILLER PIC X(9).             
WORKING-STORAGE SECTION.             
01 WS-CPBALT-STATUS PIC 9(2).       
PROCEDURE DIVISION.                 
B1000-INITIAL-PROCESS.               
    OPEN INPUT ALTINDEX-DETAILS-FILE.
    DISPLAY WS-CPBALT-STATUS.       
    ACCEPT CPSYS-01-LOCATION.       
    DISPLAY CPSYS-01-LOCATION.       
C1000-MAIN-PROCESS.                 
    START ALTINDEX-DETAILS-FILE KEY = CPSYS-01-LOCATION
             INVALID KEY GO TO D1000-CLOSE-PROCESS.   
    PERFORM UNTIL WS-CPBALT-STATUS >= 10               
    READ ALTINDEX-DETAILS-FILE NEXT                   
    DISPLAY WS-EMPLOYEE-RECORD                         
    DISPLAY WS-CPBALT-STATUS                           
    END-PERFORM.                                       
D1000-CLOSE-PROCESS.                                   
    CLOSE ALTINDEX-DETAILS-FILE.                       
    STOP RUN.
ALTERNATE INDEX FILE
Code:
KEY OF RECORD - BANGLORE                                                       
.....BANGLOREE00006                                                             
KEY OF RECORD - CHENNAI                                                         
.....CHENNAI E00004                                                             
KEY OF RECORD - NOIDA                                                           
.....NOIDA   E00002                                                             
KEY OF RECORD - PUNE                                                           
.....PUNE    E00001E00003E00005                                                 
KSDS FILE
Code:

KEY OF RECORD - E00001                                                 
E00001 SRIKANTH     22-11-1979 SOFTWARE-ENGINEER BXP-PROJECTS  PUNE
KEY OF RECORD - E00002                                                 
E00002 SRINIVAS     22-02-1980 SOFTWARE-ENGINEER BOOTS         NOIDA   
KEY OF RECORD - E00003                                                 
E00003 SRIPUSHPA    08-08-1981 SOFTWARE-ENGINEER BT-PROJECTS   PUNE   
KEY OF RECORD - E00004                                                 
E00004 SUJATHA      22-11-1980 SOFTWARE-ENGINEER NHS-SERVICES  CHENNAI
KEY OF RECORD - E00005                                                 
E00005 SUNITHA      22-11-1982 SOFTWARE-ENGINEER HR-DEPT       PUNE   
KEY OF RECORD - E00006                                                 
E00006 SRIVIDYA     16-05-1983 SOFTWARE-ENGINEER RETL-PROJECTS BANGLORE
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: Wed Aug 29, 2007 6:19 pm    Post subject:
Reply with quote

Hello,

Please post the IDCAMS DEFINE.

I believe your problem is that you have the wrong dsn in this DD
Code:
//GO.CPBSYS DD DSN=BOYSD2.VSAM.ALTIND,DISP=SHR                         
Back to top
View user's profile Send private message
Rajesh S
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 54
Location: Chennai

PostPosted: Wed Aug 29, 2007 7:05 pm    Post subject:
Reply with quote

hai kanth_das

problem in ur dsn name..

Give the dsn as follows:

//COBOLIN DD DSN=LOAD MODULE,DISP=SHR
//CPBSYS DD DSN=BOYSD2.VSAM.KSDS,DISP=SHR
//CPBSYS1 DD DD DSN=BOYSD2.VSAM.PATHIND,DISP=SHR

try this..... Give Base cluster(ksds) and path only...

Regards

Rajesh S
Back to top
View user's profile Send private message
kanth_das

New User


Joined: 22 Aug 2007
Posts: 5
Location: Pune

PostPosted: Thu Aug 30, 2007 12:50 pm    Post subject: Reply to: JCL for reading a record from an alternate index f
Reply with quote

Hi Rajesh S,

i have tried as mentioned by u.
But still i am not getting the result as expected.
I am getting the same file status code 35.
Back to top
View user's profile Send private message
kanth_das

New User


Joined: 22 Aug 2007
Posts: 5
Location: Pune

PostPosted: Thu Aug 30, 2007 1:59 pm    Post subject: Reply to: JCL for reading a record from an alternate index f
Reply with quote

Hi Rajesh S,

Thankx, i got the output.

icon_biggrin.gif
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: Thu Aug 30, 2007 6:19 pm    Post subject:
Reply with quote

Hello,

Thank you for telling us that you have it working icon_smile.gif

It may help others if you post the jcl that now works.
Back to top
View user's profile Send private message
kanth_das

New User


Joined: 22 Aug 2007
Posts: 5
Location: Pune

PostPosted: Mon Sep 03, 2007 11:44 am    Post subject: Reply to: JCL for reading a record from an alternate index f
Reply with quote

THIS IS THE JCL THAT IS WORKING

Code:
//BOYSD2S JOB ,SRIKANTH,CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=BOYSD2
//STEP1 EXEC PROC=IGYWCLG                                             
//COBOL.SYSIN DD DSN=BOYSD2.JCL.PDS1(ALTINDX),DISP=SHR                 
//GO.CPBSYS DD DSN=BOYSD2.VSAM.KSDS,DISP=SHR                         
//CPBSYS1 DD DSN=BOYSD2.VSAM.PATHIND,DISP=SHR                             
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT DD SYSOUT=*                                                   
//SYSIN DD *                                                           
CHENNAI                                                               
/*                                                                     
//

icon_biggrin.gif



________________________

SRIKANTH .D
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: Mon Sep 03, 2007 10:50 pm    Post subject:
Reply with quote

Thank you for posting yojr JCL icon_smile.gif
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 query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm

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