Bruce,

The order of the clauses is important.  I always use in the following sequence:

EXECUTE stmt PASSLIST RTNLIST CAPTURING RETURNING


Marc Rutherford
Principal Programmer/Analyst
Advanced Bionics LLC
661 362-1754


-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bruce Decker
Sent: Wednesday, November 20, 2013 3:56 PM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] UD PE 7.1.0 - Use of EXECUTE with the RTNLIST option

This is a reply to a old post but since this is the top search result for 
RTNLIST, I'll post a reply with useful info.  Unidata's BASIC compiler seems to 
be quite particular about the ORDER of the clauses on an Execute.  Put RTNLIST, 
RETURNING AND CAPTURING in the wrong order and you'll see a error like this:

Compiling Unibasic: mysource\test4 in mode 'p'.
main program: syntax error at or before
<line 7> EXECUTE \SELECT VOC\ RETURNING junk RTNLIST l.voc CAPTURING screen;
         ------------------------------------------^
Misuse of reserved word 'RTNLIST'
Expecting: end-of-file,END

compilation failed

Here is the code with examples of proper order of the clauses on an execute and 
the final example of EXECUTE producing the failure message above...

done = @FALSE
l.voc = \\
i = 0
EXECUTE \SELECT VOC\ RTNLIST l.voc                                              
 
; *compiles ok
EXECUTE \SELECT VOC\ RTNLIST l.voc RETURNING junk                          ;
*compiles ok
EXECUTE \SELECT VOC\ RTNLIST l.voc RETURNING junk CAPTURING screen; *compiles 
ok EXECUTE \SELECT VOC\ RETURNING junk RTNLIST l.voc CAPTURING screen; *fails 
compile LOOP READNEXT id FROM l.voc ELSE done = @TRUE UNTIL done DO
   i=+ 1
REPEAT
CRT i:\ records counted\
STOP 



--
View this message in context: 
http://u2-universe-unidata.1073795.n5.nabble.com/UD-PE-7-1-0-Use-of-EXECUTE-with-the-RTNLIST-option-tp7096p42187.html
Sent from the U2 - Users mailing list archive at Nabble.com.
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to