|
Y que pasa si quieres empezar a leer desde un registro especifico
considerando la clave3, otra vez volver a "brujulear" ,
bueno tu mismo.
Yo veo correctamente descrito las líneas que corresponden al acceso, tanto
en el primer email como en este.
es un tema de datos que mueves y hacen que no se posicione
correctamente.
salu2
----- Original Message -----
Sent: Thursday, June 10, 2004 4:40
PM
Subject: RE: Instrucción START en
Cobol/400
Ya lo
tengo.
Leídos vuestros correos y vuelto a "brujulear" el manual, la
solución pasa
por:
9100-SITUAR-OG.
MOVE "1" TO
EXISTE-OG.
START LKIC3OG3 KEY = CLAVE1,
CLAVE2 INVALID MOVE "0" TO
EXISTE-OG.
9100-SITUAR-OG-X.
EXIT.
MOVE CRMSIC(4:10) TO
OGDEAP
MOVE T-LNK-PRE(P) TO
OGR6CF
PERFORM 9100-SITUAR-OG THRU 9100-SITUAR-OG-X IF
SI-EXISTE-OG
PERFORM 9110-LEER-OG THRU 9110-LEER-OG-X
Es decir, la
tercera clave (CLAVE3) ni tocarla (como en RPG).
Entonces en el START,
que normalmente ponemos EXTERNAL-DESCRIBED-KEY (los 3 campos de clave), poner
sólo las dos primeras y posicionarse por IGUAL (=).
Curioso,
¿verdad?. " Nunca te acostarás sin aprender una cosa más".
Muchas
gracias a todos.
Francisco Rubio Enríquez Analista Cibernos
Consulting, SAU
----- Mensaje Original ----- De: [EMAIL PROTECTED] Fecha: Jueves 10
Junio 2004 12:58 Asunto: RE: Instrucción START en
Cobol/400
> Así a bote pronto no veo que inicialices los campos
clave antes de > hacer el > start. Así que vete a saber donde se
posiciona. > > -----Mensaje original----- > De:
RUBIO-ENRIQUEZ Franc >
[EMAIL PROTECTED] > Enviado el: jueves, 10 de
junio de 2004 11:58 > Para: Forum Help/400 > Asunto: Instrucción
START en Cobol/400 > > > 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 > parcialeshay 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 >
cettetransmission 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
> intendedonly 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 > [EMAIL PROTECTED] >
> _____________________________________________________ >
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 > [EMAIL PROTECTED] >
-- 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]
|