Monday, September 26, 2011

Easytireve : VSAM file processing code snippets

Logic similar to START and READ NEXT


POINT my-vsam-file GE WS-KEY STATUS
IF my-vsam-file :FILE-STATUS GT 0 

GET my-vsam-file STATUS
IF 
my-vsam-file:FILE-STATUS EQ 0

Direct read

READ MY-VSAM-FILE KEY WS-KEY STATUS  
IF MY-VSAM-FILE:FILE-STATUS GT 0 

Update a VSAM record

READ MY-VSAM-FILE KEY WS-KEY STATUS
change necessary values..
WRITE MY-VSAM-FILE UPDATE STATUS 
IF MY-VSAM-FILE:FILE-STATUS GT 0

Delete a VSAM record

READ MY-VSAM-FILE KEY WS-KEY STATUS
WRITE MY-VSAM-FILE DELETE STATUS 

IF MY-VSAM-FILE:FILE-STATUS GT 0

Insert a VSAM record

WRITE MY-VSAM-FILE ADD STATUS 
IF MY-VSAM-FILE:FILE-STATUS GT 0

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.