Hola:
me est� despistando el START y READ NEXT para un fichero que tiene 3 claves y solo s�
el valor de las 2 primeras y la tercera es una fecha.
Bien, os muestro el estado del tema:
Registro-1 Clave1: 16908 Clave2: ES 00057 Clave3: 2004-05-15
Registro-2 Clave2: 16908 Clave2: ES 00058 Clave3: 2004-05-15
Las sentencias Cobol son las siguientes:
SELECT LKIC3OG3 ASSIGN TO DATABASE-LKIC3OG3
ORGANIZATION IS INDEXED
RECORD KEY IS EXTERNALLY-DESCRIBED-KEY
WITH DUPLICATES
ACCESS IS DYNAMIC.
---------------------------------------------------------------------
03 EXISTE-OG PIC X.
88 SI-EXISTE-OG VALUE B"1".
88 NO-EXISTE-OG VALUE B"0".
03 FIN-OG PIC X.
88 SI-FIN-OG VALUE B"1".
88 NO-FIN-OG VALUE B"0".
-------------------------------------------------------------------------------
9100-SITUAR-OG.
MOVE "1" TO EXISTE-OG.
START LKIC3OG3 KEY NOT < EXTERNALLY-DESCRIBED-KEY
INVALID MOVE "0" TO EXISTE-OG.
9100-SITUAR-OG-X.
EXIT.
9110-LEER-OG.
MOVE "0" TO FIN-OG.
READ LKIC3OG3 NEXT AT END MOVE "1" TO FIN-OG.
9110-LEER-OG-X.
EXIT.
---------------------------------------------------------------------------
MOVE CRMSIC(4:10) TO CLAVE1
MOVE T-LNK-PRE(P) TO CLAVE2
MOVE "0001-01-01" TO CLAVE3
PERFORM 9100-SITUAR-OG THRU 9100-SITUAR-OG-X
IF SI-EXISTE-OG
PERFORM 9110-LEER-OG THRU 9110-LEER-OG-X
PERFORM
UNTIL SI-FIN-OG
OR OGDEAP NOT = CLAVE1
OR OGR6CF NOT = CLAVE2
PERFORM 2200-DESCRIP THRU 2200-DESCRIP-X
END-PERFORM
END-IF
-----------------------------------------------------------------
Bueno, pu�s del START el switch me dice que ha encontrado algo donde posicionarse ya
que lo hace por NOT < (es decir mayor o igual).
Al hacer el READ NEXT, curiosamente me lee el segundo registro y no el primero que
pensaba que era el registro MAYOR (debido a la fecha le�da).
Entonces no me cumple la tercera condici�n del PERFORM.
Yo que vengo de programar en RPG, con SETLL y READ, y con claves parciales hay cosas
del Cobol que no comprendo.
�Me pod�is ayudar?
Muchas gracias de antemano.
Francisco Rubio Enr�quez
Analista
Cibernos Consulting, SAU
-- Disclaimer ------------------------------------
Ce message ainsi que les eventuelles pieces jointes constituent une correspondance
privee et confidentielle a l'attention exclusive du destinataire designe ci-dessus. Si
vous n'etes pas le destinataire du present message ou une personne susceptible de
pouvoir le lui delivrer, il vous est signifie que toute divulgation, distribution ou
copie de cette transmission est strictement interdite. Si vous avez recu ce message
par erreur, nous vous remercions d'en informer l'expediteur par telephone ou de lui
retourner le present message, puis d'effacer immediatement ce message de votre systeme.
***
This e-mail and any attachments is a confidential correspondence intended only for use
of the individual or entity named above. If you are not the intended recipient or the
agent responsible for delivering the message to the intended recipient, you are hereby
notified that any disclosure, distribution or copying of this communication is
strictly prohibited. If you have received this communication in error, please notify
the sender by phone or by replying this message, and then delete this message from
your system.
_____________________________________________________
Forum.HELP400 es un servicio m�s de NEWS/400.
� Publicaciones Help400, S.L. - Todos los derechos reservados
http://www.help400.es
_____________________________________________________
Para darte de baja, env�a el mensaje resultante de pulsar
mailto:[EMAIL PROTECTED]