Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 000100 identification division.
- 000200 program-id. relativefile.
- 000250 author. retromagazine.
- 000300 environment division.
- 000400 configuration section.
- 000500 source-computer. c64.
- 000600 object-computer. c64.
- 000601 input-output section.
- 000602 file-control.
- 000603 select reldata1 assign to disk-1541 drive-8
- 000604 organization is relative
- 000605 access mode is random
- 000606 relative key is rel-key
- 000620 file status is file-st.
- 001000 data division.
- 001001 file section.
- 001002 fd reldata1
- 001003 label record is standard
- 001004 value of file-id is "@0:reldata1".
- 001010 01 data-record.
- 001011 02 rel-key pic 9(5).
- 001015 02 nominativo.
- 001016 04 nome pic x(15).
- 001017 04 cognome pic x(15).
- 001020 02 residenza.
- 001026 04 indirizzo pic x(20).
- 001027 04 cap pic 9(5).
- 001028 04 citta pic x(25).
- 001100 working-storage section.
- 001101 77 scelta pic x.
- 001102 77 clear-home value chr 147 pic x.
- 001103 77 return-codice value chr 13 pic x.
- 001104 77 rvs-on value chr 18 pic x.
- 001114 77 file-st pic xx.
- 001115 77 pausa pic x.
- 001116 77 num-record pic 9(5).
- 001200 procedure division.
- 001201 main.
- 001202 open i-o reldata1.
- 001203 if file-st not equal to "00"
- 001204 display "errore in apertura file"
- 001205 stop run.
- 001305 mostra-menu.
- 001310 display clear-home.
- 001320 display rvs-on "--> menu principale - file relative <--".
- 001330 display " " return-codice.
- 001335 display " " return-codice.
- 001340 display "i-inserimento nuovo record" return-codice.
- 001350 display "l-lettura sequenziale" return-codice.
- 001355 display "r-ricerca per account" return-codice.
- 001356 display "c-cancellazione account" return-codice.
- 001360 display "u-uscita" return-codice.
- 001370 accept scelta.
- 001380 if scelta equal to "u"
- 001385 close reldata1
- 001390 display rvs-on "-->programma terminato. arrivederci..."
- 001400 stop run.
- 001410 if scelta equal to "l"
- 001411 move 00001 to rel-key
- 001412 perform leggi-file thru end-leggi-file.
- 001420 if scelta equal to "i" perform scrivi-file thru end-scrivi-file.
- 001430 if scelta equal to "r"
- 001431 display " " return-codice
- 001432 display "rel-key (in formato 00000):" return-codice
- 001433 accept num-record
- 001434 move num-record to rel-key
- 001439 perform leggi-file thru end-leggi-file.
- 001440 if scelta equal to "c" perform cancella-record thru end-cancella-record.
- 001450 go to mostra-menu.
- 001500***********************
- 001700 leggi-file.
- 001701 display rvs-on "-- lettura dati --" return-codice.
- 001707 leggi-loop.
- 001710 read reldata1 invalid key go to end-lettura.
- 001711 if file-st not equal to "00"
- 001712 display "errore in apertura file"
- 001713 stop run.
- 001715 display "rel-key: ".
- 001716 display rel-key return-codice.
- 001720 display "nome: ".
- 001725 display nome return-codice.
- 001730 display "cognome: ".
- 001735 display cognome return-codice.
- 001740 display "indirizzo: ".
- 001745 display indirizzo return-codice.
- 001750 display " " cap " - " citta return-codice.
- 001900 display rvs-on "-->prossimo record -->x per terminare".
- 001905 accept pausa.
- 001910 if pausa not equal to "x"
- 001911 add 1 to rel-key
- 001915 go to leggi-loop.
- 002000 end-lettura.
- 002005 display rvs-on "-- lettura dati terminata--" return-codice.
- 002006 accept pausa.
- 002030 perform mostra-menu.
- 002035 end-leggi-file.
- 002040 exit.
- 002045***********************
- 002500 scrivi-file.
- 002501 display clear-home.
- 002502 display rvs-on "--> inserimento dati <--".
- 002503 display " " return-codice.
- 002510 accetta-dati.
- 002511 display rvs-on "rel-key (in formato 00000):" return-codice.
- 002512 accept rel-key.
- 002530 display rvs-on "nome (max 15 chr):" return-codice.
- 002540 accept nome.
- 002550 display rvs-on "cognome (max 15 chr):" return-codice.
- 002560 accept cognome.
- 002570 display rvs-on "indirizzo (max 20 chr):" return-codice.
- 002580 accept indirizzo.
- 002581 display rvs-on "cap (max 5 numeri):" return-codice.
- 002582 accept cap.
- 002584 display rvs-on "citta' (max 25 chr):" return-codice.
- 002585 accept citta.
- 002590 display rvs-on "i dati sono corretti? s/n" return-codice.
- 002600 accept scelta.
- 002605 if scelta equal "n"
- 002610 go to accetta-dati.
- 002620 write data-record
- 002621 invalid key display "chiave non valida!".
- 002630 if file-st not equal to "00"
- 002640 display "errore in scrittura file"
- 002650 stop run.
- 002700 perform mostra-menu.
- 002710 end-scrivi-file.
- 002715 exit.
- 002716********************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement