Algorithm
Algorithm
DATA-ENTRY.
1. Move zero to SW.
2. Display “< (***** STUDENT INFORMATION *****)>”.
3. Display “Student Number: ” .
4. Accept W-STUDNUM.
5. Display “Student Name: ” .
6. Accept W-STUDNAME.
7. Display “Course & Year: ”.
8. Accept W-STUDCRSYR.
9. Display “Standing : “.
10. Accept W-STUDSTAND.
11. Move the data from W-STUD-REC to STUD-REC.
12. Move the data from W-STUD-REC to STUD-REC and use it as an output
invalid key move 1 to SW.
13. If SW = 0
13a. Display “MORE RECORDS (Y/N ): ? ”.
14. Accept RESP.
15. If RESP = “Y” or “y”
15a. Perform again the DATA-ENTRY routine.
16. If RESP = “N” or “n”
16a. End.
17. If SW is NOT EQUAL to 0
17a. Display “Student Number Existing !!!”.
17b. Display “ “.
17c. Display “REPEAT THE PROCESS...”.
18. Return the value to DATA-ENTRY.
PROGRAM NO. 2: INDEXED FILE PROCESSING
DATA-ENTRY .
1. Move zero to SW.
2. Display “<(***** STUDENT INFORMATION *****)>” .
3. Display “Student Number: ”.
4. Accept W-STUDNUM.
5. Display “Student Name: ” .
6. Accept W-STUDNAME.
7. Display “ Course & Year : ”.
8. Accept W-STUDCRSYR.
9. Display “Standing : “.
10. Accept W-STUDSTAND.
11. Move the data from W-STUD-REC to STUD-REC.
12. Move the data from W-STUD-REC to STUD-REC and use it as an output
invalid key move 1 to SW.
13. If SW = 0
13a. Display “ MORE RECORDS (Y/N) ? : ”.
14. Accept RESP.
15. If RESP = “Y” or “y”
15a. Perform again the DATA-ENTRY routine.
16. If RESP = “N” or “n”
16a. End.
17. If SW is NOT EQUAL to 0
17a. Display “Student Number Existing !!!”.
17b. Display “ “.
17c. Display “REPEAT THE PROCESS...”.
18. Return the value to DATA-ENTRY .
PROGRAM NO. 2: INDEXED FILE PROCESSING
DATA-ENTRY .
19. Move zero to SW.
20. Display “<(***** STUDENT INFORMATION *****)>” .
21. Display “Student Number: ”.
22. Accept W-STUDNUM.
23. Display “Student Name: ” .
24. Accept W-STUDNAME.
25. Display “ Course & Year : ”.
26. Accept W-STUDCRSYR.
27. Display “Standing : “.
28. Accept W-STUDSTAND.
29. Move the data from W-STUD-REC to STUD-REC.
30. Move the data from W-STUD-REC to STUD-REC and use it as an output
invalid key move 1 to SW.
31. If SW = 0
13a. Display “ MORE RECORDS (Y/N) ? : ”.
32. Accept RESP.
33. If RESP = “Y” or “y”
15a. Perform again the DATA-ENTRY routine.
34. If RESP = “N” or “n”
16a. End.
35. If SW is NOT EQUAL to 0
17a. Display “Student Number Existing !!!”.
17b. Display “ “.
17c. Display “REPEAT THE PROCESS...”.
36. Return the value to DATA-ENTRY .
PROGRAM NO. 3: INDEXED FILE PROCESSING
3. Move the stored data from STUDFILE to W-STUD-REC until the value of NO-MORE-RECORD is
“Y”.
5. Close STUDFILE.
6. End.
DATA-DISP-RTN.
3. Move the stored data on the next record of STUDFILE into W-STUD-REC until the
value of NO-MORE-RECORD is “Y”.
5. Close STUDFILE.
6. End.
DATA-DISP-RTN.
VIEW-DATA-RTN.
1. Move zero to SW.
2. Display “[***** RETRIEVAL OF RECORD *****]”.
3. Display “ “.
4. Display “Student Number : ”.
5. Accept W-STUDNUM.
6. Move the data from W-STUDNUM to STUD-NUM.
7. Start STUDFILE INVALID KEY
7a. Display “RECORD NOT FOUND !!!”.
8. Move 1 to SW.
9. If SW = 0
9a. Transfer the data from STUDFILE into W-STUD-REC.
9b. Display “<<===== STUDENT INFORMATION =====>>”.
9c. Display “Student Number : “ W-STUDNUM.
9d. Display “Student Name : ” W-STUDNAME.
9e. Display “Course & Year: ” W-STUDCRSYR.
9f. Display “Academic Standing: ” W-STUDSTAND.
9g. Display “ “.
9h. Display “VIEW ANOTHER RECORD (Y/N) ? :”.
10. Accept RESP.
11. If RESP = “Y” or “y”
11a. Perform the VIEW-DATA-RTN routine.
12. If RESP = “Y” or “y”
12a. End.
13. Return the value of VIEW-DATA-RTN.
PROGRAM NO. 6: INDEXED FILE PROCESSING
RETRIEVAL OF INDIVIDUAL RECORD
USING RANDOM ACCESS MODE
VIEW-DATA-RTN.
1. Move zero to SW.
2. Display “[***** RETRIEVAL OF RECORD *****]”.
3. Display “ “.
4. Display “Student Number :”.
5. Accept W-STUDNUM.
6. Move the data from W-STUDNUM to STUDNUM.
7. Move the data from STUDFILE to W-STUD-REC INVALID KEY
7a. Display “RECORD NOT FOUND !!!”.
8. If SW = 0
8a. Transfer the data from STUDFILE into W-STUD-REC.
8b. Display “<<===== STUDENT INFORMATION =====>>”.
8c. Display “Student Number : “ W-STUDNUM.
8d. Display “Student Name : ” W-STUDNAME.
8e. Display “Course & Year: ” W-STUDCRSYR.
8f. Display “Academic Standing: ” W-STUDSTAND.
8g. Display “ “.
8h. Display “VIEW ANOTHER RECORD (Y/N) ? :”.
9. Accept RESP.
10. If RESP = “Y” or “y”
10a. Perform the VIEW-DATA-RTN routine.
11. If RESP = “Y” or “y”
11a. End.
12. Return the value of VIEW-DATA-RTN.
PROGRAM NO. 7: INDEXED FILE PROCESSING
RETRIEVAL OF INDIVIDUAL RECORD
USING DYNAMIC ACCESS MODE
SEQ-DATA-RTN.
1. Move 0 to SW.
2. Display “[***** RETRIEVAL OF RECORD *****]”.
3. Display “ “.
4. Display “Student Number :”.
5. Accept W-STUDNUM.
6. Move the data from W-STUDNUM to STUDNUM.
7. Move the data from STUDFILE to W-STUD-REC INVALID KEY
7a. Display “RECORD NOT FOUND !!!”.
8. If SW = 0
8a. Transfer the data from STUDFILE into W-STUD-REC.
9. Perform DISP-RTN routine.
10. Return the value of SEQ-DATA-RTN.
RDM-DATA-RTN.
1. Move 0 to SW.
2. Display “[***** RETRIEVAL OF RECORD *****]”.
3. Display “ “.
4. Display “Student Number :”.
5. Accept W-STUDNUM.
6. Move the data from W-STUDNUM to STUDNUM.
7. Read the data from STUFILE into W-STUD-REC INVALID KEY.
7a. Display “RECORD NOT FOUND !!!”.
8. If SW = 0
8a. Perform the routine DISP-RTN.
9. Return the value of RDM-DATA-RTN.
DISP-RTN.
RDM-DATA-RTN.
1. Move 0 to SW.
2. Display “[***** RETRIEVAL OF RECORD *****]”.
3. Display “ “.
4. Display “Student Name :”.
5. Accept W-STUDNAME .
6. Move the data from W-STUDNAME to STUDNAME.
7. Read the data stored into STUDFILE to W-STUD-REC using STUDNAME key.
8. If key is INVALID, display “RECORD NOT FOUND !!!”.
8a. Move 1 to SW.
9. If SW = 0
9a. Move “ Y” to NO-MORE-record.
10. Perform the DISP-RTN routine.
11. Return the value of RDM-DATA-RTN.
DISP-RTN.
EDIT-RTN.
EDIT-RECORD.
1. Move 0 to SW.
2. Display “[***** EDITING OF RECORD *****]”.
3. Display “ “.
4. Display “Student Number :”.
5. Accept W-STUDNUM.
6. Move the data from W-STUDNUM to STUDNUM.
7. Start STUDFILE INVALID KEY.
7a. Display “RECORD NOT FOUND !!”.
7b. Display “ “.
7c. Display “TRY AGAIN ...”
7d. Move 1 to SW.
8. If SW = 0
8a. Read the data from STUDFILE into W-STUD-REC.
8b. Display “<<===== STUDENT INFORMATION =====>>”.
8c. Display “Student Name : ” W-STUDNAME.
8d. Display “Course & Year: ” W-STUDCRSYR.
8e. Display “Academic Standing: ” W-STUDSTAND.
8f. Display “ “.
8g. Display “[** UPDATE VALUES **]”.
8h. Display “Student Name: ” .
8i. Accept W-STUDNAME.
8j. Display “ Course & Year : ”.
8k. Accept W-STUDCRSYR.
8l. Display “Standing : “.
8m. Accept W-STUDSTAND.
8n. Display “ARE ALL THE ENTRIES CORRECT (Y/N) ? : “.
9. Accept RESP2.
10. If RESP2 = “Y” or “y”
10a. Perform again the EDIT-RECORD routine.
11. If RESP2 = “N” or “n”
11a.End.
12. Return the value of EDIT-RECORD.
REWRITE-DATA-RTN.
EDIT-RTN.
EDIT-RECORD.
1. Move 0 to SW.
2. Display “[***** EDITING OF RECORD *****]”.
3. Display “ “.
4. Display “Student Number :”.
5. Accept W-STUDNUM.
6. Move the data from W-STUDNUM to STUDNUM.
7. Read STUDFILE into W-STUD-REC INVALID KEY.
7a. Display “RECORD NOT FOUND !!”.
7b. Display “ “.
7c. Display “TRY AGAIN ...”
7d. Move 1 to SW.
8. If SW = 0
8a. Read tha data from STUDFILE into W-STUD-REC.
8b. Display “<<===== STUDENT INFORMATION =====>>”.
8c. Display “Student Name : ” W-STUDNAME.
8d. Display “Course & Year: ” W-STUDCRSYR.
8e. Display “Academic Standing: ” W-STUDSTAND.
8f. Display “ “.
8g. Display “[** UPDATE VALUES **]”.
8h. Display “Student Name: ” .
8i. Accept W-STUDNAME.
8j. Display “ Course & Year : ”.
8k. Accept W-STUDCRSYR.
8l. Display “Standing : “.
8m. Accept W-STUDSTAND.
8n. Display “ARE ALL THE ENTRIES CORRECT (Y/N) ? : “.
9. Accept RESP2.
10. If RESP2 = “Y” or “y”
10a. Perform again the EDIT-RECORD routine.
11. If RESP2 = “N” or “n”
11a.End.
12. Return the value of EDIT-RECORD.
REWRITE-DATA-RTN.
5a.End.
DELETE-DATA-RTN.
1. Move 0 to SW.
2. Display “[***** DELETION OF RECORD *****]”.
3. Display “ “.
4. Display “Student Number :”.
5. Accept W-STUDNUM.
6. Move the data from W-STUDNUM to STUDNUM.
7. Start STUDFILE INVALID KEY.
7a. Display “RECORD NOT FOUND !!!”.
7b. Move 1 to SW.
8. If SW = 0
8a. Read the data from STUDFILE to W-STUD-REC.
8b.Display “<<===== STUDENT INFORMATION =====>>”.
8c. Display “Student Number : “ W-STUDNUM.
8d. Display “Student Name : ” W-STUDNAME.
8e. Display “Course & Year: ” W-STUDCRSYR.
8f. Display “Academic Standing: ” W-STUDSTAND.
8f. Display “ “.
8g. Display “DELETE ANOTHER RECORD (Y/N) ? :”.
9. Accept RESP.
10. If RESP = “Y” or “y”
10a. Perform again DELETE-DATA-RTN routine.
11. If RESP = “N” or “n”
11a. End.
12. Return the value of DELETE-DATA-RTN.
PROGRAM NO. 12: INDEXED FILE PROCESSING
DELETION OF INDIVIDUAL RECORD
USING RANDOM ACCESS MODE
DELETE-DATA-RTN.
1. Move 0 to SW.
2. Display “[***** DELETION OF RECORD *****]”.
3. Display “ “.
4. Display “Student Number :”.
5. Accept W-STUDNUM.
6. Move the data from W-STUDNUM to STUDNUM
7. Read the data from the STUDFILE into W-STUD-REC INVALID KEY.
7a. Display “RECORD NOT FOUND !!!”.
7b. Move 1 to SW.
8. If SW = 0
8a. Read the data from STUDFILE to W-STUD-REC.
8b.Display “<<===== STUDENT INFORMATION =====>>”.
8c. Display “Student Number : “ W-STUDNUM.
8d. Display “Student Name : ” W-STUDNAME.
8e. Display “Course & Year: ” W-STUDCRSYR.
8f. Display “Academic Standing: ” W-STUDSTAND.
8f. Display “ “.
8g. Display “DELETE ANOTHER RECORD (Y/N) ? :”.
9. Accept RESP.
10. If RESP = “Y” or “y”
10a. Perform again DELETE-DATA-RTN routine.
11. If RESP = “N” or “n”
11a.. End.
12. Return the value of DELETE-DATA-RTN.
PROGRAM NO. 3: INDEXED FILE PROCESSING
3. Move the stored data from STUDFILE to W-STUD-REC until the value of NO-MORE-RECORD is
“Y”.
5. Close STUDFILE.
6. End.
DATA-DISP-RTN.
3. Move the stored data on the next record of STUDFILE into W-STUD-REC until the
value of NO-MORE-RECORD is “Y”.
5. Close STUDFILE.
6. End.
DATA-DISP-RTN.
VIEW-DATA-RTN.
14. Move zero to SW.
15. Display “[***** RETRIEVAL OF RECORD *****]”.
16. Display “ “.
17. Display “Student Number : ”.
18. Accept W-STUDNUM.
19. Move the data from W-STUDNUM to STUD-NUM.
20. Start STUDFILE INVALID KEY
7a. Display “RECORD NOT FOUND !!!”.
21. Move 1 to SW.
22. If SW = 0
9a. Transfer the data from STUDFILE into W-STUD-REC.
9b. Display “<<===== STUDENT INFORMATION =====>>”.
9c. Display “Student Number : “ W-STUDNUM.
9d. Display “Student Name : ” W-STUDNAME.
9e. Display “Course & Year: ” W-STUDCRSYR.
9f. Display “Academic Standing: ” W-STUDSTAND.
9g. Display “ “.
9h. Display “VIEW ANOTHER RECORD (Y/N) ? :”.
23. Accept RESP.
24. If RESP = “Y” or “y”
11a. Perform the VIEW-DATA-RTN routine.
25. If RESP = “Y” or “y”
12a. End.
26. Return the value of VIEW-DATA-RTN.
VIEW-DATA-RTN.
13. Move zero to SW.
14. Display “[***** RETRIEVAL OF RECORD *****]”.
15. Display “ “.
16. Display “Student Number :”.
17. Accept W-STUDNUM.
18. Move the data from W-STUDNUM to STUDNUM.
19. Move the data from STUDFILE to W-STUD-REC INVALID KEY
7a. Display “RECORD NOT FOUND !!!”.
20. If SW = 0
8a. Transfer the data from STUDFILE into W-STUD-REC.
8b. Display “<<===== STUDENT INFORMATION =====>>”.
8c. Display “Student Number : “ W-STUDNUM.
8d. Display “Student Name : ” W-STUDNAME.
8e. Display “Course & Year: ” W-STUDCRSYR.
8f. Display “Academic Standing: ” W-STUDSTAND.
8g. Display “ “.
8h. Display “VIEW ANOTHER RECORD (Y/N) ? :”.
21. Accept RESP.
22. If RESP = “Y” or “y”
10a. Perform the VIEW-DATA-RTN routine.
23. If RESP = “Y” or “y”
11a. End.
24. Return the value of VIEW-DATA-RTN.
SEQ-DATA-RTN.
11. Move 0 to SW.
12. Display “[***** RETRIEVAL OF RECORD *****]”.
13. Display “ “.
14. Display “Student Number :”.
15. Accept W-STUDNUM.
16. Move the data from W-STUDNUM to STUDNUM.
17. Move the data from STUDFILE to W-STUD-REC INVALID KEY
7a. Display “RECORD NOT FOUND !!!”.
18. If SW = 0
8a. Transfer the data from STUDFILE into W-STUD-REC.
19. Perform DISP-RTN routine.
20. Return the value of SEQ-DATA-RTN.
RDM-DATA-RTN.
DISP-RTN.
RDM-DATA-RTN.
12. Move 0 to SW.
13. Display “[***** RETRIEVAL OF RECORD *****]”.
14. Display “ “.
15. Display “Student Name :”.
16. Accept W-STUDNAME .
17. Move the data from W-STUDNAME to STUDNAME.
18. Read the data stored into STUDFILE to W-STUD-REC using STUDNAME key.
19. If key is INVALID, display “RECORD NOT FOUND !!!”.
8a. Move 1 to SW.
20. If SW = 0
9a. Move “ Y” to NO-MORE-record.
21. Perform the DISP-RTN routine.
22. Return the value of RDM-DATA-RTN.
DISP-RTN.
EDIT-RTN.
EDIT-RECORD.
REWRITE-DATA-RTN.
EDIT-RTN.
EDIT-RECORD.
REWRITE-DATA-RTN.
5a.End.
DELETE-DATA-RTN.
DELETE-DATA-RTN.