You need to number your selects.  See below.

Gordon J. Glorfield
Sr. Applications Developer
MAMSI (A UnitedHealth Company)
301-360-8839 



> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Amy Cook
> Sent: Tuesday, June 22, 2004 3:16 PM
> To: [EMAIL PROTECTED]
> Subject: [U2] Is it possible to nest 'LOOP / WHILE READNEXT / 
> REPEAT' loops?
> 
> 
[snip]
> 
> 001:  CMD = 'SELECT SOHDR WITH DATE GE "':BEG.DT:'" AND WITH 
> DATE LE "':END.DT:'"'
> 
> 002:  CMD = CMD:' AND WITH STATUS NE "C" AND WITH PROD_LINE = 
> "':ITP:'" TO 1'
> 
> 003:  EXECUTE CMD CAPTURING JUNK    ;*need error trap
> 
> 004:  LOOP
> 
> 005:  WHILE READNEXT ITEM.ID FROM 1 DO
> 
> 006:    READ SOH.REC FROM SOH,ITEM.ID ELSE SOH.REC=''
> 
> 007:    BILL2 = SOH.REC<2>                                    
>  ;*bill-to
> cust
> 
> 008:    SLSPROG.ID = SOH.REC<15>
> 
> 009:    READV SLSPROG FROM SYST,"OSC*":SLSPROG.ID,4 ELSE SLSPROG=''
> ;*SlsProg Desc
> 
> 010:    CMD1 = 'SELECT SODET = "':ITEM.ID:']" TO 2'
> 
> 011:    EXECUTE CMD1 CAPTURING SOD.JUNK
> 
> 012:    LOOP
> 
> 013:    WHILE READNEXT SOD.ID FROM 2 DO
> 
> 014:      READ SOD.REC FROM SOD,SOD.ID ELSE SOD.REC=''         ;*line
> record
> 
> 
> 
> 
> 
> 
> 
> Anyway...does anyone have either
> 
> (a) a way to nest READNEXT's, or
> 
> (b) another suggestion? ...I was thinking maybe a count on 
> the records of the 2nd file that meet my criteria, then a FOR/NEXT...?
> -------
> u2-users mailing list
> [EMAIL PROTECTED]
> To unsubscribe please visit http://listserver.u2ug.org/
> 


This e-mail, including attachments, may include confidential and/or 
proprietary information, and may be used only by the person or entity to 
which it is addressed. If the reader of this e-mail is not the intended 
recipient or his or her authorized agent, the reader is hereby notified 
that any dissemination, distribution or copying of this e-mail is 
prohibited. If you have received this e-mail in error, please notify the 
sender by replying to this message and delete this e-mail immediately. 
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to