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
 
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts User access certification In Mainfram... Virendra Shambharkar All Other Mainframe Topics 4 Tue Oct 03, 2017 12:32 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am

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