Advertisement
marcocunhasilva

Programa de Notas em COBOL com código de erro.

Mar 16th, 2023
824
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
COBOL 18.33 KB | Source Code | 0 0
  1.  NOTAS.COB                               Thu Mar 16 22:37:53 2023    Page   1
  2.  line number source line   Microsoft COBOL                       Version 2.20
  3.  
  4.    1         IDENTIFICATION DIVISION.
  5.    2         PROGRAM-ID.  NOTAS.
  6.    3        *
  7.    4         ENVIRONMENT DIVISION.
  8.    5         CONFIGURATION SECTION.
  9.    6         SPECIAL-NAMES.
  10.    7             DECIMAL-POINT IS COMMA.
  11.    8         DATA DIVISION.
  12.    9         WORKING-STORAGE SECTION.
  13.   10         01  VARIAVEIS-SISTEMA.
  14.   11             02  WS-N1          PIC 9(02)V9 VALUE ZEROS.
  15.   12             02  WS-N2          PIC 9(02)V9 VALUE ZEROS.
  16.   13             02  WS-N3          PIC 9(02)V9 VALUE ZEROS.
  17.   14             02  WS-N4          PIC 9(02)V9 VALUE ZEROS.
  18.   15             02  WS-MEDIA       PIC 9(02)V9 VALUE ZEROS.
  19.   16             02  WS-MEDIA-FINAL PIC ZZ,Z.
  20.   17                     02  WS-LINHA       PIC 9(02) VALUE ZEROS.
  21.   18             02  WS-LIMPA       PIC X(30) VALUE SPACES.
  22.   19                     02  WS-LIMPA-MSG   PIC X(66) VALUE SPACES.
  23.   20             02  RESPOSTA       PIC A.
  24.   21             02  CODIGO         PIC X(03) VALUE "SIM".
  25.   22             02  WS-PAUSA       PIC X(01).
  26.   23         01  WS-DATA.
  27.   24             02  WS-ANO         PIC 9(02) VALUE ZEROS.
  28.   25             02  WS-MES         PIC 9(02) VALUE ZEROS.
  29.   26             02  WS-DIA         PIC 9(02) VALUE ZEROS.
  30.   27         01  WS-HORA.
  31.   28             02  WS-HOR         PIC 9(02) VALUE ZEROS.
  32.   29             02  WS-MIN         PIC 9(02) VALUE ZEROS.
  33.   30             02  WS-SEG         PIC 9(02) VALUE ZEROS.
  34.   31             02  WS-CSE         PIC 9(02) VALUE ZEROS.
  35.   32         SCREEN SECTION.
  36.   33         01  SS-LIMPA-TELA.
  37.   34             02 BLANK SCREEN.
  38.   35         01  SS-JANELA.
  39.   36                 02 BLANK SCREEN.
  40.   37             02 LINE 02 COLUMN 01 VALUE "+--------------------------------
  41.  38             02 LINE 02 COLUMN 41 VALUE "---------------------------------
  42.   39             02 LINE 03 COLUMN 01 VALUE "+
  43.  40             02 LINE 03 COLUMN 41 VALUE "
  44.   41             02 LINE 04 COLUMN 01 VALUE "+--------------------------------
  45.  42             02 LINE 04 COLUMN 41 VALUE "---------------------------------
  46.   43             02 LINE 05 COLUMN 01 VALUE "+
  47.  44             02 LINE 05 COLUMN 41 VALUE "
  48.   45             02 LINE 06 COLUMN 01 VALUE "+
  49.  46             02 LINE 06 COLUMN 41 VALUE "
  50.   47             02 LINE 07 COLUMN 01 VALUE "+
  51.  48             02 LINE 07 COLUMN 41 VALUE "
  52.   49             02 LINE 08 COLUMN 01 VALUE "+
  53.  50             02 LINE 08 COLUMN 41 VALUE "
  54.   51             02 LINE 09 COLUMN 01 VALUE "+
  55.  52             02 LINE 09 COLUMN 41 VALUE "
  56.   53             02 LINE 10 COLUMN 01 VALUE "+
  57.  54             02 LINE 10 COLUMN 41 VALUE "
  58.   55             02 LINE 11 COLUMN 01 VALUE "+
  59.  56             02 LINE 11 COLUMN 41 VALUE "
  60.   57             02 LINE 12 COLUMN 01 VALUE "+
  61. NOTAS.COB                               Thu Mar 16 22:37:53 2023    Page   2
  62. line number source line   Microsoft COBOL                       Version 2.20
  63.  
  64.  58             02 LINE 12 COLUMN 41 VALUE "
  65.   59             02 LINE 13 COLUMN 01 VALUE "+
  66.  60             02 LINE 13 COLUMN 41 VALUE "
  67.   61             02 LINE 14 COLUMN 01 VALUE "+
  68.  62             02 LINE 14 COLUMN 41 VALUE "
  69.   63             02 LINE 15 COLUMN 01 VALUE "+
  70.  64             02 LINE 15 COLUMN 41 VALUE "
  71.   65             02 LINE 16 COLUMN 01 VALUE "+
  72.  66             02 LINE 16 COLUMN 41 VALUE "
  73.   67             02 LINE 17 COLUMN 01 VALUE "+
  74.  68             02 LINE 17 COLUMN 41 VALUE "
  75.   69             02 LINE 18 COLUMN 01 VALUE "+
  76.  70             02 LINE 18 COLUMN 41 VALUE "
  77.   71             02 LINE 19 COLUMN 01 VALUE "+
  78.  72             02 LINE 19 COLUMN 41 VALUE "
  79.   73             02 LINE 20 COLUMN 01 VALUE "+
  80.  74             02 LINE 20 COLUMN 41 VALUE "
  81.   75             02 LINE 21 COLUMN 01 VALUE "+
  82.  76             02 LINE 21 COLUMN 41 VALUE "
  83.   77             02 LINE 22 COLUMN 01 VALUE "+--------------------------------
  84.  78             02 LINE 22 COLUMN 41 VALUE "---------------------------------
  85.   79             02 LINE 23 COLUMN 01 VALUE "+ MENSAGEM: [
  86.  80                     02 LINE 23 COLUMN 41 VALUE "
  87.   81             02 LINE 24 COLUMN 01 VALUE "+--------------------------------
  88.  82             02 LINE 24 COLUMN 41 VALUE "---------------------------------
  89.   83         01  SS-TITULO.
  90.   84             02 LINE 02 COLUMN 30 VALUE "C O N T R O L E  D E  M E D I A S
  91.  85         PROCEDURE DIVISION.
  92.  86         INICIO.
  93.  87        *     DISPLAY (01, 01) ERASE.
  94.  88             DISPLAY SS-LIMPA-TELA.
  95.  89        *    DISPLAY SS-JANELA.
  96.  90             DISPLAY SS-TITULO.
  97.  91        *     ACCEPT WS-DATA FROM DATE.
  98.  92        *     ACCEPT WS-HORA FROM TIME.
  99.  93        *     DISPLAY JANELA.
  100.  94        *     DISPLAY (23, 69) WS-DIA "/" WS-MES "/20" WS-ANO.
  101.  95        *     DISPLAY (23, 58) WS-HOR ":" WS-MIN ":" WS-SEG.
  102.  96        *     PERFORM ROT-LIMPA-TELA.
  103.  97             PERFORM ROT-JANELA.
  104.  98        *     PERFORM ROT-TITULO.
  105.  99             PERFORM ROT-MOSTRA-DADOS.
  106. 100             PERFORM ROT-PREENCHE-NOTAS.
  107. 101             PERFORM ROT-CALCULA-MEDIA.
  108. 102        *    PERFORM 050-LIMPA-DADOS.
  109. 103    
  110. 104         ROT-MOSTRA-DADOS.
  111. 105             DISPLAY(06, 07) 'NOTA 1: '.
  112. 106             DISPLAY(07, 07) 'NOTA 2: '.
  113. 107                     DISPLAY(08, 07) 'NOTA 3: '.
  114. 108                     DISPLAY(09, 07) 'NOTA 4: '.
  115. 109                     DISPLAY(10, 07) 'MEDIA.: '.
  116. 110         ROT-PREENCHE-NOTAS.
  117. 111             ACCEPT (06, 15) WS-N1 WITH PROMPT.
  118. 112             ACCEPT (07, 15) WS-N2 WITH PROMPT.
  119. 113             ACCEPT (08, 15) WS-N3 WITH PROMPT.
  120. 114             ACCEPT (09, 15) WS-N4 WITH PROMPT.
  121. NOTAS.COB                               Thu Mar 16 22:37:53 2023    Page   3
  122. line number source line   Microsoft COBOL                       Version 2.20
  123.  
  124. 115         ROT-CALCULA-MEDIA.
  125. 116             COMPUTE WS-MEDIA = (WS-N1 + WS-N2 + WS-N3 + WS-N4)/4.
  126. 117             MOVE WS-MEDIA TO MFINAL.
  127. 118             DISPLAY (10, 32) MFINAL.
  128. 119             IF WS-MEDIA < 7,0 AND WS-MEDIA > 3,9
  129. 120        *       DISPLAY TELA-COMP1
  130. 121                DISPLAY (23, 14) "PROVA FINAL               "
  131. 122                ACCEPT (08, 32) WS-PF WITH PROMPT
  132. 123                COMPUTE WS-MEDIA = (WS-MEDIA + WS-PF)/2
  133. 124                MOVE WS-MEDIA TO MFINAL
  134. 125                DISPLAY (10, 32) MFINAL.
  135. 126             IF WS-MEDIA = 7 OR WS-MEDIA > 7
  136. 127                DISPLAY (23, 14) "APROVADO - Tecle ENTER.   ".
  137. 128             IF WS-MEDIA < 7
  138. 129                DISPLAY (23, 14) "REPROVADO - Tecle ENTER.  ".
  139. 130             ACCEPT (23, 41) WS-PAUSA.
  140. 131         ROT-SAIR-OU-NAO.
  141. 132             DISPLAY(23, 14) "Deseja recalcular? (S/N)  ".
  142. 133             ACCEPT(23, 39) RESPOSTA.
  143. 134             IF RESPOSTA = "N" or "n"
  144. 135                MOVE "NAO" TO CODIGO
  145. 136                GO TO ROT-FIM
  146. 137             ELSE IF RESPOSTA = "S" or "s"
  147. 138                NEXT SENTENCE
  148. 139             ELSE IF RESPOSTA NOT EQUAL TO "S" or "s" or "N" or "n"
  149. 140                DISPLAY(23, 14) "Digitar (S/N) ou (s/n):          "
  150. 141                ACCEPT(23, 37)  RESPOSTA
  151. 142                DISPLAY(23, 14) "                                 ".
  152. 143         ROT-LIMPA-TELA.
  153. 144                 DISPLAY(01, 01) ERASE.
  154. 145         ROT-LIMPA-DADOS.
  155. 146             DISPLAY (06, 32) WS-LIMPA.
  156. 147             DISPLAY (07, 32) WS-LIMPA.
  157. 148             DISPLAY (08, 32) WS-LIMPA.
  158. 149             DISPLAY (10, 32) WS-LIMPA.
  159. 150             DISPLAY (23, 14) "                                         ".
  160. 151             GO TO INICIO.
  161. 152         ROT-TELA-FIM.
  162. 153             DISPLAY(10, 20) '***************************************'.
  163. 154             DISPLAY(11, 20) '*                                     *'.
  164. 155                     DISPLAY(12, 20) '*         DESENVOLVIDO POR
  165. 156             DISPLAY(13, 20) '*                                     *'.
  166. 157             DISPLAY(14, 20) '*   MARCO ANTONIO CUNHA DA SILVA      *'.
  167. 158             DISPLAY(15, 20) '*                                     *'.
  168. 159             DISPLAY(16, 20) '*                                     *'.
  169. 160             DISPLAY(17, 20) '***************************************'.
  170. 161        ***---------- FIM DO PROGRAMA NOTAS ---------***
  171. 162         ROT-FIM.
  172. 163             PERFORM ROT-LIMPA-TELA.
  173. 164             DISPLAY ROT-TELA-FIM.
  174. 165             STOP RUN.
  175. 0038:Syntax error in SCREEN SECTION description. 02
  176. 0038:/W/Redundant clause ignored. 02
  177. 0038:/W/Redundant clause ignored. 41
  178. 0038:/W/Redundant clause ignored. ----------------------
  179. 0039:Syntax error in SCREEN SECTION description. 02
  180. 0039:/W/Redundant clause ignored. 03
  181. NOTAS.COB                               Thu Mar 16 22:37:53 2023    Page   4
  182. line number source line   Microsoft COBOL                       Version 2.20
  183.  
  184. 0039:/W/Redundant clause ignored. 01
  185. 0039:/W/Redundant clause ignored. +                    
  186. 0040:Syntax error in SCREEN SECTION description. 02
  187. 0040:/W/Redundant clause ignored. 03
  188. 0040:/W/Redundant clause ignored. 41
  189. 0040:/W/Redundant clause ignored.                      
  190. 0041:Syntax error in SCREEN SECTION description. 02
  191. 0041:/W/Redundant clause ignored. 04
  192. 0041:/W/Redundant clause ignored. 01
  193. 0041:/W/Redundant clause ignored. +---------------------
  194. 0042:Syntax error in SCREEN SECTION description. 02
  195. 0042:/W/Redundant clause ignored. 04
  196. 0042:/W/Redundant clause ignored. 41
  197. 0042:/W/Redundant clause ignored. ----------------------
  198. 0043:Syntax error in SCREEN SECTION description. 02
  199. 0043:/W/Redundant clause ignored. 05
  200. 0043:/W/Redundant clause ignored. 01
  201. 0043:/W/Redundant clause ignored. +                    
  202. 0044:Syntax error in SCREEN SECTION description. 02
  203. 0044:/W/Redundant clause ignored. 05
  204. 0044:/W/Redundant clause ignored. 41
  205. 0044:/W/Redundant clause ignored.                      
  206. 0045:Syntax error in SCREEN SECTION description. 02
  207. 0045:/W/Redundant clause ignored. 06
  208. 0045:/W/Redundant clause ignored. 01
  209. 0045:/W/Redundant clause ignored. +                    
  210. 0046:Syntax error in SCREEN SECTION description. 02
  211. 0046:/W/Redundant clause ignored. 06
  212. 0046:/W/Redundant clause ignored. 41
  213. 0046:/W/Redundant clause ignored.                      
  214. 0047:Syntax error in SCREEN SECTION description. 02
  215. 0047:/W/Redundant clause ignored. 07
  216. 0047:/W/Redundant clause ignored. 01
  217. 0047:/W/Redundant clause ignored. +                    
  218. 0048:Syntax error in SCREEN SECTION description. 02
  219. 0048:/W/Redundant clause ignored. 07
  220. 0048:/W/Redundant clause ignored. 41
  221. 0048:/W/Redundant clause ignored.                      
  222. 0049:Syntax error in SCREEN SECTION description. 02
  223. 0049:/W/Redundant clause ignored. 08
  224. 0049:/W/Redundant clause ignored. 01
  225. 0049:/W/Redundant clause ignored. +                    
  226. 0050:Syntax error in SCREEN SECTION description. 02
  227. 0050:/W/Redundant clause ignored. 08
  228. 0050:/W/Redundant clause ignored. 41
  229. 0050:/W/Redundant clause ignored.                      
  230. 0051:Syntax error in SCREEN SECTION description. 02
  231. 0051:/W/Redundant clause ignored. 09
  232. 0051:/W/Redundant clause ignored. 01
  233. 0051:/W/Redundant clause ignored. +                    
  234. 0052:Syntax error in SCREEN SECTION description. 02
  235. 0052:/W/Redundant clause ignored. 09
  236. 0052:/W/Redundant clause ignored. 41
  237. 0052:/W/Redundant clause ignored.                      
  238. 0053:Syntax error in SCREEN SECTION description. 02
  239. 0053:/W/Redundant clause ignored. 10
  240. 0053:/W/Redundant clause ignored. 01
  241. NOTAS.COB                               Thu Mar 16 22:37:53 2023    Page   5
  242. line number source line   Microsoft COBOL                       Version 2.20
  243.  
  244. 0053:/W/Redundant clause ignored. +                    
  245. 0054:Syntax error in SCREEN SECTION description. 02
  246. 0054:/W/Redundant clause ignored. 10
  247. 0054:/W/Redundant clause ignored. 41
  248. 0054:/W/Redundant clause ignored.                      
  249. 0055:Syntax error in SCREEN SECTION description. 02
  250. 0055:/W/Redundant clause ignored. 11
  251. 0055:/W/Redundant clause ignored. 01
  252. 0055:/W/Redundant clause ignored. +                    
  253. 0056:Syntax error in SCREEN SECTION description. 02
  254. 0056:/W/Redundant clause ignored. 11
  255. 0056:/W/Redundant clause ignored. 41
  256. 0056:/W/Redundant clause ignored.                      
  257. 0057:Syntax error in SCREEN SECTION description. 02
  258. 0057:/W/Redundant clause ignored. 12
  259. 0057:/W/Redundant clause ignored. 01
  260. 0057:/W/Redundant clause ignored. +                    
  261. 0058:Syntax error in SCREEN SECTION description. 02
  262. 0058:/W/Redundant clause ignored. 12
  263. 0058:/W/Redundant clause ignored. 41
  264. 0058:/W/Redundant clause ignored.                      
  265. 0059:Syntax error in SCREEN SECTION description. 02
  266. 0059:/W/Redundant clause ignored. 13
  267. 0059:/W/Redundant clause ignored. 01
  268. 0059:/W/Redundant clause ignored. +                    
  269. 0060:Syntax error in SCREEN SECTION description. 02
  270. 0060:/W/Redundant clause ignored. 13
  271. 0060:/W/Redundant clause ignored. 41
  272. 0060:/W/Redundant clause ignored.                      
  273. 0061:Syntax error in SCREEN SECTION description. 02
  274. 0061:/W/Redundant clause ignored. 14
  275. 0061:/W/Redundant clause ignored. 01
  276. 0061:/W/Redundant clause ignored. +                    
  277. 0062:Syntax error in SCREEN SECTION description. 02
  278. 0062:/W/Redundant clause ignored. 14
  279. 0062:/W/Redundant clause ignored. 41
  280. 0062:/W/Redundant clause ignored.                      
  281. 0063:Syntax error in SCREEN SECTION description. 02
  282. 0063:/W/Redundant clause ignored. 15
  283. 0063:/W/Redundant clause ignored. 01
  284. 0063:/W/Redundant clause ignored. +                    
  285. 0064:Syntax error in SCREEN SECTION description. 02
  286. 0064:/W/Redundant clause ignored. 15
  287. 0064:/W/Redundant clause ignored. 41
  288. 0064:/W/Redundant clause ignored.                      
  289. 0065:Syntax error in SCREEN SECTION description. 02
  290. 0065:/W/Redundant clause ignored. 16
  291. 0065:/W/Redundant clause ignored. 01
  292. 0065:/W/Redundant clause ignored. +                    
  293. 0066:Syntax error in SCREEN SECTION description. 02
  294. 0066:/W/Redundant clause ignored. 16
  295. 0066:/W/Redundant clause ignored. 41
  296. 0066:/W/Redundant clause ignored.                      
  297. 0067:Syntax error in SCREEN SECTION description. 02
  298. 0067:/W/Redundant clause ignored. 17
  299. 0067:/W/Redundant clause ignored. 01
  300. 0067:/W/Redundant clause ignored. +                    
  301. NOTAS.COB                               Thu Mar 16 22:37:53 2023    Page   6
  302. line number source line   Microsoft COBOL                       Version 2.20
  303.  
  304. 0068:Syntax error in SCREEN SECTION description. 02
  305. 0068:/W/Redundant clause ignored. 17
  306. 0068:/W/Redundant clause ignored. 41
  307. 0068:/W/Redundant clause ignored.                      
  308. 0069:Syntax error in SCREEN SECTION description. 02
  309. 0069:/W/Redundant clause ignored. 18
  310. 0069:/W/Redundant clause ignored. 01
  311. 0069:/W/Redundant clause ignored. +                    
  312. 0070:Syntax error in SCREEN SECTION description. 02
  313. 0070:/W/Redundant clause ignored. 18
  314. 0070:/W/Redundant clause ignored. 41
  315. 0070:/W/Redundant clause ignored.                      
  316. 0071:Syntax error in SCREEN SECTION description. 02
  317. 0071:/W/Redundant clause ignored. 19
  318. 0071:/W/Redundant clause ignored. 01
  319. 0071:/W/Redundant clause ignored. +                    
  320. 0072:Syntax error in SCREEN SECTION description. 02
  321. 0072:/W/Redundant clause ignored. 19
  322. 0072:/W/Redundant clause ignored. 41
  323. 0072:/W/Redundant clause ignored.                      
  324. 0073:Syntax error in SCREEN SECTION description. 02
  325. 0073:/W/Redundant clause ignored. 20
  326. 0073:/W/Redundant clause ignored. 01
  327. 0073:/W/Redundant clause ignored. +                    
  328. 0074:Syntax error in SCREEN SECTION description. 02
  329. 0074:/W/Redundant clause ignored. 20
  330. 0074:/W/Redundant clause ignored. 41
  331. 0074:/W/Redundant clause ignored.                      
  332. 0075:Syntax error in SCREEN SECTION description. 02
  333. 0075:/W/Redundant clause ignored. 21
  334. 0075:/W/Redundant clause ignored. 01
  335. 0075:/W/Redundant clause ignored. +                    
  336. 0076:Syntax error in SCREEN SECTION description. 02
  337. 0076:/W/Redundant clause ignored. 21
  338. 0076:/W/Redundant clause ignored. 41
  339. 0076:/W/Redundant clause ignored.                      
  340. 0077:Syntax error in SCREEN SECTION description. 02
  341. 0077:/W/Redundant clause ignored. 22
  342. 0077:/W/Redundant clause ignored. 01
  343. 0077:/W/Redundant clause ignored. +---------------------
  344. 0078:Syntax error in SCREEN SECTION description. 02
  345. 0078:/W/Redundant clause ignored. 22
  346. 0078:/W/Redundant clause ignored. 41
  347. 0078:/W/Redundant clause ignored. ----------------------
  348. 0079:Syntax error in SCREEN SECTION description. 02
  349. 0079:/W/Redundant clause ignored. 23
  350. 0079:/W/Redundant clause ignored. 01
  351. 0079:/W/Redundant clause ignored. + MENSAGEM: [        
  352. 0080:Syntax error in SCREEN SECTION description. 02
  353. 0080:/W/Redundant clause ignored. 23
  354. 0080:/W/Redundant clause ignored. 41
  355. 0080:/W/Redundant clause ignored.                      
  356. 0081:Syntax error in SCREEN SECTION description. 02
  357. 0081:/W/Redundant clause ignored. 24
  358. 0081:/W/Redundant clause ignored. 01
  359. 0081:/W/Redundant clause ignored. +---------------------
  360. 0082:Syntax error in SCREEN SECTION description. 02
  361. NOTAS.COB                               Thu Mar 16 22:37:53 2023    Page   7
  362. line number source line   Microsoft COBOL                       Version 2.20
  363.  
  364. 0082:/W/Redundant clause ignored. 24
  365. 0082:/W/Redundant clause ignored. 41
  366. 0082:/W/Redundant clause ignored. ----------------------
  367. 0083:Syntax error in SCREEN SECTION description. 01
  368. 0083:Syntax error in SCREEN SECTION description. SS-TITULO
  369. 0085:Syntax error in SCREEN SECTION description. PROCEDURE
  370. 0090:Statement deleted due to erroneous syntax. SS-TITULO
  371. 0097:Procedure-name is unresolvable. ROT-JANELA
  372. 0117:Unrecognizable element is ignored.  MFINAL
  373. 0118:Statement deleted due to erroneous syntax. MFINAL
  374. 0122:Statement deleted due to erroneous syntax. WS-PF
  375. 0122:Unrecognizable element is ignored.  WITH
  376. 0122:Unrecognizable element is ignored.  PROMPT
  377. 0123:Unrecognizable element is ignored.  WS-PF
  378. 0123:Unrecognizable element is ignored.  )
  379. 0123:Unrecognizable element is ignored.  /
  380. 0123:Unrecognizable element is ignored.  2
  381. 0124:Unrecognizable element is ignored.  MFINAL
  382. 0125:Statement deleted due to erroneous syntax. MFINAL
  383. 0164:Statement deleted due to erroneous syntax. ROT-TELA-FIM
  384.  
  385.  197 errors or warnings
  386.  
  387.   Data area size =   920
  388.   Code area size =   788
  389.  
  390.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement