Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DD name access using multiple logical names

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

New User


Joined: 02 Feb 2010
Posts: 41
Location: Bangalore

PostPosted: Wed Apr 30, 2014 2:45 pm    Post subject: DD name access using multiple logical names
Reply with quote

JCL DD statement.
Code:
//FILE1  DD DSN=HLQ.FILE1,DISP=SHR


Code:
FILE-CONTROL.

SELECT   FILE1-SEQ                    ASSIGN          TO FILE1
                                      ACCESS MODE     IS SEQUENTIAL
                                      ORGANIZATION    IS INDEXED
                                      RECORD KEY      IS FILE1-SEQ-KEY
                                      STATUS          IS FILE1-SEQ-STATUS.

SELECT FILE1-DYN                      ASSIGN          TO FILE1
                                      ACCESS MODE     IS DYNAMIC
                                      ORGANIZATION    IS INDEXED
                                      RECORD KEY      IS FILE1-DYN-KEY         
                                      STATUS          IS FILE1-DYN-STATUS.


Code:
FILE SECTION.

FD   FILE1-SEQ           
     DATA RECORD IS FILE1-SEQ-RECORD.
01   FILE1-SEQ-RECORD.
      10  FILE1-SEQ-KEY       PIC X(09).
      10  FILLER              PIC X(91).

FD  FILE1-DYN           
    DATA RECORD IS FILE1-DYN-RECORD.
01  FILE1-DYN-RECORD.
     10  FILE1-DYN-KEY       PIC X(09).
     10  FILLER              PIC X(91).



Code:
PROCEDURE DIVISION.
 
 OPEN FILE1-SEQ           
 OPEN FILE1-DYN   


Both open were successful.

Also when we perform the read on both files it works correctly. i.e using FILE1-SEQ, you read sequentially and using FILE1-DYN you can read file randomly.

Can anyone help me to understand concept, how this works?
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8518
Location: Dubuque, Iowa, USA

PostPosted: Wed Apr 30, 2014 4:17 pm    Post subject:
Reply with quote

What do you not understand? You are accessing the same file multiple times in different ways simultaneously. Nothing different than accessing two different files at the same time. Remember, each file you declare in COBOL has its own record pointer and buffers so FILE1-SEQ and FILE1-DYN are accessing the file independently of one another.

Note that if you update the file you may start experiencing problems.
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 Finding a string and concatinating mu... ArunkumarGanesan DFSORT/ICETOOL 11 Thu Jan 09, 2020 5:59 pm
No new posts Is multiple program names allowed in ... Sakthidevi PL/I & Assembler 1 Tue Nov 19, 2019 11:12 pm
No new posts Count From Multiple Inputs Tyler Dunbar DFSORT/ICETOOL 5 Tue Nov 12, 2019 1:07 am
No new posts Capture DSN names through SORT / IDCAMS reach2abhinavtyagi DFSORT/ICETOOL 8 Tue Nov 05, 2019 7:33 pm
No new posts Is possible to concatenate multiple P... Poha Eater DFSORT/ICETOOL 6 Fri Aug 02, 2019 1:21 pm

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