Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Files sequenziali - file.cbl

file.cbl

Caricato da: Netarrow
Scarica il programma completo

  1. identification division.
  2. program-id. ciao.
  3.  
  4. environment division.
  5. input-output section.
  6. file-control.
  7.     select nomefile assign to "prova.dat".
  8.  
  9. data division.
  10. file section.
  11.     fd nomefile label record standard.
  12. 01  rec.
  13.   02  campo1 pic 99.
  14.   02  campo2 occurs 5 times pic x(10).
  15.  
  16. 77 i pic 99.
  17.  
  18. procedure division.
  19.  
  20. inizio.
  21. open output nomefile.
  22. set campo1 to 5.
  23.  
  24. perform varying i from 1 by 1 until i > 5
  25. set campo2(i) to "ciao"
  26. end-perform.
  27.  
  28. write rec.
  29. close nomefile.
  30.  
  31. open input nomefile.
  32.  
  33. read nomefile next record
  34. end-read.
  35.  
  36. close nomefile.
  37.  
  38. display rec.
  39.  
  40. stop run.