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
 

 

sample program for dynamic access of VSAM file

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

New User


Joined: 14 Dec 2005
Posts: 22
Location: India

PostPosted: Fri Jan 20, 2006 4:29 pm    Post subject: sample program for dynamic access of VSAM file
Reply with quote

Hi
Can anybody send me sample cobol program for dynamic access of VSAM file..
Back to top
View user's profile Send private message

khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Fri Jan 20, 2006 5:50 pm    Post subject: Dynamic Access
Reply with quote

hi jwell rymbei,

U have not mentioned for read or rite.. any how i have written for write. U can refer this code and u can develop the rest. hope this code will help more...

Code:
IDENTIFICATION DIVISION.
PROGRAM-ID. XX
ENVIRONMENT DIVISION.
INPUT-OUTPUT DIVISION.
FILE-CONTROL.
          SELECT xx ASSIGN TO DD1
          ORGANIZATION IS INDEXED
          ACCESS MODE IS DYNAMIC
          RECORD KEY IS .....
          FILE STATUS IS FS1.

DATA DIVISION.
FILE SECTION.
FD xx
01 pp
..

...
WORKING-STORAGE SECTION.
...
PROCEDURE DIVISION.
PROC1.
OPEN OUTPUT xx.
MOVE VARNAME TO pp.
WRITE pp INVALID KEY DISPLAY "KEY: " xxx.
CLOSE xx.
STOP RUN.
Back to top
View user's profile Send private message
jwell rymbei

New User


Joined: 14 Dec 2005
Posts: 22
Location: India

PostPosted: Mon Jan 23, 2006 1:24 pm    Post subject: sample program for dynamic access of VSAM file
Reply with quote

Thanks k.a.khamaurutheen
Back to top
View user's profile Send private message
jwell rymbei

New User


Joined: 14 Dec 2005
Posts: 22
Location: India

PostPosted: Mon Jan 23, 2006 3:42 pm    Post subject: sample program for dynamic access of VSAM file
Reply with quote

Hi K.A,
Do you have any sample source to read a vsam indexed file. I need to read an indexed file first randomly then keep on reading until the record gets changed. Let say I have a file whose key field is employee code and sequence number. Now for a single policy the file can have multiple records (note policy will remain same but sequnce number will be different). Now an employee code will be passed to the program and it should write all the records related that particular employee. icon_question.gif
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Mon Jan 23, 2006 3:56 pm    Post subject: VSAM
Reply with quote

Hi jwell rymbei,

Hope u might have completed any mainframe course. so u may go thru that materials so that u will get the solution easily.....
Back to top
View user's profile Send private message
sbalajibe

New User


Joined: 15 Aug 2005
Posts: 62

PostPosted: Tue Jan 24, 2006 9:02 am    Post subject:
Reply with quote

Hi jwell rymbei,

answer to u r question is use control break logic in u r program

read the record from a file check for u r key
then read all the records till there is a change in the key value


thanks
Balaji
Back to top
View user's profile Send private message
jwell rymbei

New User


Joined: 14 Dec 2005
Posts: 22
Location: India

PostPosted: Tue Jan 24, 2006 11:31 am    Post subject: sample program for dynamic access of VSAM file
Reply with quote

Hi all,
Thanks for the help...
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us