***** DELETE A RECORD IN RRDS CLUSTER ***** IDENTIFICATION DIVISION. PROGRAM-ID. DELR. ...
***** DELETE A RECORD IN RRDS CLUSTER *****
IDENTIFICATION DIVISION.
PROGRAM-ID. DELR.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT IN-FILE ASSIGN TO DD1
ORGANIZATION IS RELATIVE
RELATIVE KEY IS REL-KEY
FILE STATUS IS FS1.
DATA DIVISION.
FILE SECTION.
FD IN-FILE.
01 IN-REC.
05 ENO PIC 9(4).
05 ENAME PIC X(4).
05 SAL PIC 9(5).
05 FILLER PIC X(67).
WORKING-STORAGE SECTION.
01 FS1 PIC 9(2).
01 REL-KEY PIC 9(4).
PROCEDURE DIVISION.
OPEN I-O IN-FILE.
DISPLAY "FS1: " FS1.
MOVE 2 TO REL-KEY.
DELETE IN-FILE
DISPLAY "FS1: " FS1.
CLOSE IN-FILE.
STOP RUN.
***** DELETE A RECORD IN KSDS CLUSTER *****
IDENTIFICATION DIVISION.
PROGRAM-ID. DELR.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT IN-FILE ASSIGN TO DD1
ORGANIZATION IS INDEXED
RECORD KEY IS ENO
FILE STATUS IS FS1.
DATA DIVISION.
FILE SECTION.
FD IN-FILE.
01 IN-REC.
05 ENO PIC 9(4).
05 ENAME PIC X(4).
05 SAL PIC 9(5).
05 FILLER PIC X(67).
WORKING-STORAGE SECTION.
01 FS1 PIC 9(2).
PROCEDURE DIVISION.
OPEN I-O IN-FILE.
DISPLAY "FS1: " FS1.
MOVE 0002 TO ENO.
DELETE IN-FILE
DISPLAY "FS1: " FS1.
CLOSE IN-FILE.
STOP RUN.
File Program's in COBOL:
File Program's in COBOL:
- PS TO RRDS CLUSTER (WRITING)
- PS TO KSDS CLUSTER (WRITE)
- RUNJCL TO RRDS (WRITE)
- RUNJCL TO RRDS (WRITE)
- RUNJCL TO KSDS CLUSTER(WRITE)
- FETCH A RECORD BY USING RANDOM IN RRDS CLUSTER
- FETCH A RECORD BY USING RANDOM IN KSDS CLUSTER
- FETCHING RECORDS BY USING DYNAMIC IN RRDS CLUSTER
- FETCH RECORDS BY USIING DYNAMIC IN KSDS CLUSTER
- INSERT A RECORD IN RRDS CLUSTER
- INSERT A RECORD IN KSDS CLUSTER
- REWRITE A RECORD IN RRDS CLUSTER
- REWRITE A RECORD IN KSDS CLUSTER
- DELETE A RECORD IN RRDS CLUSTER
1 comment
just check some tags related to delete command of vsam files in cobol . you have written the same program for different vsam structures.
Post a Comment