View previous topic :: View next topic
|
Author |
Message |
sakthivel janarthanan Currently Banned New User
Joined: 01 Mar 2007 Posts: 6 Location: Chennai
|
|
|
|
Hi All,
Could any one Help me ?
I need Relative file Concepts and If possible Please send me a simple program .
Regards,
Sakthivel Janarthanan |
|
Back to top |
|
|
sachin_star3 Warnings : 1 New User
Joined: 30 Sep 2006 Posts: 78 Location: pune
|
|
|
|
The relative file concept comes when you want use key as relative record number,
the relative file consist of slotes i.always fixed, the maximum and average(minimum) record size must be same
there can following operation possible with RRDS
1] Deletion
2] insertion
3] updation
4] write
5]read
the access mode are 1]random
2]dynamic
3]sequential
the relative file organisation is fatser than other organisation but only limit is the key is not part of file i.e. not included in field
it always star from 1
for example.the relative mostly you can use in telephone exchane where the the numeric no is key
i given you one simpe programe for read the relative file
Code: |
ID DIVISION.
PROGRAME-ID. WWW.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FILE1 ASSIGN TO DD1
ORGANIZATION IS RELATIVE
ACCESS MODE IS SEQUENTIAL
RELATIVE KEY IS RKEY
FILE STATUS FS1.
DATA DIVISION.
FILE SECTION.
FD FILE1.
01 MASTER.
02 X PIC X(80).
WORKING-STORAGE SECTION.
77 FS1 PIC 9(2).
PROCEDURE DIVISION.
OPEN INPUT FILE1.
READ FILE1.
IF FS1=0
DISPLAY MASTER.
CLOSE FILE1. |
FROM -
SACHIN BORASE
PUNE |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
sachin_star3 wrote: |
1] Deletion |
It has been a while, I can't remember how to delete from an RRDS, could you help? |
|
Back to top |
|
|
sachin_star3 Warnings : 1 New User
Joined: 30 Sep 2006 Posts: 78 Location: pune
|
|
|
|
deletion from RRDS Means delete the record the slot never deleted
i give you programe
Code: |
ID DIVISION
PROGRAME-ID. VVV.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FILE1 ASSIGN TO DD1
ORGANIZATION IS RELATIVE
ACCESS MODE IS SEQUENTIAL
RELATIVE KEY IS RKEY
FILE STATUS FS1.
DATA DIVISION.
FILE SECTION.
FD FILE1.
01 MASTER.
02 X PIC X(80).
WORKING-STORAGE SECTION.
77 FS1 PIC 9(2).
PROCEDURE DIVISION.
OPEN I-O FILE1.
READ FILE1.
IF FS1=0
DELETE FILE1.
DISPLAY MASTER.
CLOSE FILE1. |
FOR PARTICULAR RECORD DELETION
Code: |
ID DIVISION
PROGRAME-ID. VVV.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FILE1 ASSIGN TO DD1
ORGANIZATION IS RELATIVE
ACCESS MODE IS SEQUENTIAL
RELATIVE KEY IS RKEY
FILE STATUS FS1.
DATA DIVISION.
FILE SECTION.
FD FILE1.
01 MASTER.
02 X PIC X(80).
WORKING-STORAGE SECTION.
77 FS1 PIC 9(2).
PROCEDURE DIVISION.
MAINPARA.
PERFORM OPEN-PARA.
PERFORM READ-PARA UNTIL FS1 NOT = 0.
PERFORM CLOSE-PARA.
OPEN-PARA.
OPEN I-O FILE1.
READ-PARA.
MOVE 03 TO RKEY.
READ FILE1.
DELETE MASTER.
DISPLAY MASTER.
CLOSE FILE1. |
|
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
sachin_star3 wrote: |
deletion from RRDS Means delete the record the slot never deleted |
OK, so the slot does not get deleted, but the record does? If the slot is still there, how do you know that the record is not? |
|
Back to top |
|
|
sachin_star3 Warnings : 1 New User
Joined: 30 Sep 2006 Posts: 78 Location: pune
|
|
|
|
if we want to check the slote is empty or not by using
1] put PRINT CH IDS(/) infront of that RRDS file.
or 2] use TSO DITTO in tso command prompt
3] by using sequential reading in cobol progrm
frm -sachin borase
pune |
|
Back to top |
|
|
|