Advertisement
yassyass

Untitled

Dec 16th, 2015
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. program-id. indToSeq as "indToSeq".
  2.  
  3. environment division.
  4. configuration section.
  5. input-output section.
  6. file-control.
  7. select fispec assign to "G:\Fichier COBOL\SPECTACLE.ind"
  8. organization is indexed
  9. access mode is dynamic
  10. record key is codeSpect
  11. alternate record key is titre with duplicates
  12. alternate record key is dateRepresentation with duplicates
  13. file status is fs-spec.
  14. select listing assign to "G:\Fichier COBOL\listingSORTIE.seq"
  15. organization is line sequential
  16. file status is fs-lis.
  17. select specSeq assign to "G:\Fichier COBOL\spectacleSeq.seq"
  18. organization is line sequential
  19. file status is fs-specSeq.
  20. data division.
  21. file section.
  22. FD fispec.
  23. 01 r-spectacle.
  24. 02 codeSpect.
  25. 03 codeGenre pic x(5).
  26. 03 codeNum pic 9(2).
  27. 02 titre pic x(30).
  28. 02 numSalle pic 99.
  29. 02 dateRepresentation pic 9999.
  30. 02 tabReservCateg occurs 3.
  31. 03 nbReserv pic 9(3).
  32. FD listing.
  33. 01 r-listing pic x(80).
  34. FD specSeq.
  35. 01 r-specSeq.
  36. 02 codeGenreSeq pic x(5).
  37. 02 codeNumSeq pic 99.
  38. 02 titreSeq pic x(30).
  39. 02 numSalleSeq pic 99.
  40. 02 dateSeq pic 9(4).
  41. 02 tabCategSeq occurs 3.
  42. 03 nbReservSeq pic 999.
  43. working-storage section.
  44. 01 fs-spec pic xx.
  45. 88 erreur value "10" thru "99".
  46. 01 fs-lis pic xx.
  47. 88 fintrt value "10".
  48. 01 fs-specSeq pic xx.
  49. 88 finSpecSeq value "10".
  50. procedure division.
  51. main.
  52. perform seqtoind.
  53. perform indtoseq.
  54. seqtoind.
  55. open output fispec
  56. input specSeq.
  57. read specSeq.
  58. perform until erreur
  59. write r-spectacle from r-specseq
  60. read specSeq
  61. end-perform.
  62. close specseq fispec.
  63. indtoseq.
  64. open input fispec
  65. output listing.
  66. move spaces to codeSpect.
  67. start fispec key is > codeSpect
  68. invalid key display "fichier vide"
  69. not invalid key read fispec NEXT end-read
  70. end-start.
  71. perform until erreur
  72. write r-listing from r-spectacle end-write
  73. read fispec NEXT end-read
  74. end-perform.
  75. close fispec listing.
  76.  
  77. stop run.
  78.  
  79. end program indToSeq.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement