Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

alternate index for esds in cobol program

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

New User


Joined: 20 Apr 2007
Posts: 13
Location: chennai

PostPosted: Mon Jan 05, 2009 10:58 am    Post subject: alternate index for esds in cobol program
Reply with quote

hi everybody,

plz fill up the blanks where i mentioned "?" symbol when i tried using following code.

Code:
 IDENTIFICATION DIVISION.             
 PROGRAM-ID. XYZ.                     
 ENVIRONMENT DIVISION.                 
 INPUT-OUTPUT SECTION.                 
 FILE-CONTROL.                         
     SELECT INFILE ASSIGN TO AS-DD1   
     ORGANIZATION IS SEQUENTIAL       
     ACCESS MODE IS SEQUENTIAL         
     ALTERNATE RECORD KEY IS ??  :?  (EMPNAME)   
     FILE STATUS IS FS1.               
 DATA DIVISION.                       
 FILE SECTION.                         
 FD INFILE.                           
 01 INREC.                             
    05 EMPNO  PIC X(5).               
    05 FILLER PIC X(2).     
   05 EMPNAME   PIC X(12).             
   05 FILLER PIC X(3).                 
   05 AGE    PIC 9(2).                 
   05 FILLER PIC X(2).                 
   05 SALARY PIC 9(5).                 
   05 FILLER PIC X(49).               
WORKING-STORAGE SECTION.               
77 FS1 PIC 9(2).                       
77 EMP PIC 9(2).                       
77 ABC PIC 9(5).                       
PROCEDURE DIVISION.                   
     PERFORM 1000-OPEN-PARA.           
     PERFORM 2000-READ-PARA.           
     PERFORM 3000-CLOSE-PARA.         
1000-OPEN-PARA.                       
     OPEN INPUT INFILE.               
     ACCEPT EMPNAME.                   
 2000-READ-PARA.                             
     READ INFILE  :? AT END  DISPLAY "END OF FILE"
     NOT AT END                               
         DISPLAY "NAME:" EMPNAME             
         DISPLAY "AGE:"  AGE                 
         DISPLAY "SALARY:"  SALARY           
     END-READ.                               
 3000-CLOSE-PARA.                             
     CLOSE INFILE.                           
     STOP RUN.



Edited: Please use BBcode when You post some code, that's rather readable, Thanks...Anuj
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 Jan 05, 2009 11:09 am    Post subject:
Reply with quote

Hello,

What happens when you try this?

AFAIK, you cannot use "alternate record key" with a sequential file.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Jan 05, 2009 12:32 pm    Post subject:
Reply with quote

Hello,

You might like to check these links:

http://www.ibmmainframes.com/viewtopic.php?t=29269&highlight=esds+aix
http://www.ibmmainframes.com/viewtopic.php?t=34891&highlight=alternate
http://www.ibmmainframes.com/viewtopic.php?t=36096&highlight=alternate
Back to top
View user's profile Send private message
inbasekarmani
Warnings : 2

New User


Joined: 20 Apr 2007
Posts: 13
Location: chennai

PostPosted: Thu Jan 15, 2009 4:59 pm    Post subject: Reply to: alternate index for esds in cobol program
Reply with quote

hi dick,

I tried for this but i get confused when writing the code what to be given for alternate key name. one of my friend told that we able to create esds but we cannot use it in batch programs. only its possible for online programs. please tell that the above statement is true or false.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8002
Location: Bellevue, IA

PostPosted: Thu Jan 15, 2009 6:15 pm    Post subject:
Reply with quote

The COBOL manual includes ALTERNATE RECORD KEY only in the definition of indexed files. Based on this, I do not believe batch COBOL programs can use an alternate index on an ESDS file.
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 Jan 15, 2009 9:57 pm    Post subject:
Reply with quote

Hello,

Has this esds been in production use for a long time? If this file is part of some new development, it may be better served with a ksds which could be read sequentially or randomly by any of the keys. . .
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 RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 5 Wed Mar 29, 2017 12:47 am
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 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
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us