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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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