Jonyblog.com

Junio 11, 2008

Apuntes Certamen 1 de Cobol

Archivado en: Cobol, Programacion — Etiquetas:, , , , — Jony @ 2:04 am

Ojala que alguien alcanze a capturar estos apuntos, que estan mas ordenaditos que los que tenia en mi hoja. Pongan Continuar Leyendo para ver el apunte.

Estructura RM-COBOL 85
7 IDENTIFICATION DIVISION.
12 datos programa
7 ENVIRONMENT DIVISION.
7 configuration section.
7 special-names.
7 input-output section.
7 file-control.
12 accesos
12 organizaciones
7 DATA DIVISION.
7 file section.
7 fd nombre-estructura
12 label record is standard
12 value of file-id “nombre-archivo.dat”.
7 01 estructuras-internas-archivo.
12 02 sub-estructura-interna.
7 working-storage section.
7 01 estructuras-externas-archivo.
12 02 sub-estructuras-externas.
7 77 declaracion-variables-externas.
7 PROCEDURE DIVISION.
12 stop run.


Distintos acceso y organizaciones


ORGANIZACIÓN DIRECTA

7 file-control.
12 select nombre-estructura assign to disk
12 organization is relative
12 access mode is random
12 relative key is variable.
.
.
.
7 fd nombre-estructura
12 label record is standard
12 value of file-id “nombre-archivo.dat”.
.
.
.
7 working-storage section.
7 77 variable pic 9(1).

ORGANIZACIÓN INDEXADA

7 file-control.
12 select nombre-estructura assign to disk
12 organization is indexed
12 access mode is random
12 relative key is variable.
.
.
.
7 fd nombre-estructura
12 label record is standard
12 value of file-id “nombre-archivo.dat”.
.
.
.
7 working-storage section.
7 77 variable pic 9(1).


ORGANIZACIÓN SECUENCIAL

7 file-control.
12 select nombre-estructura assign to disk
12 organization is line sequential
.
.
.
7 fd nombre-estructura
12 label record is standard
12 value of file-id “nombre-archivo.dat”.


Ejemplos de sentencias

PERFORM EJEMPLO 1

7 ejemplos-cargas.
12 move 1 to i
12 move 0 to contcar
12 perform 5 times
12 if rutcar(i) not = 0
12 add 1 to contcar
12 end-if
12 add 1 to i
12 end-perform.

PERFORM EJEMPLO 2

12 perform campoi thru campof varying i from 1 by 1 until i = limite (numerico)
7 campoi.
12 display campo(i).
7 campof.
12 exit.

Aca les dejo el archivo en Word, para que no se den la flojera de copiar y darle formato a lo anterior.

apuntos-certamen-cobol-1.doc

Tau.

No hay comentarios »

Aún no hay comentarios.

Redifusión RSS de los comentarios de la entrada. URL para Trackback

Deja un comentario

Gestionado con WordPress