Return a list of keys after a SELECT (CALL EB.READLIST)

Posted by
Print Friendly, PDF & Email

CALL EB.READLIST (SELECT.STATEMENT, KEY.LIST, LIST.NAME, SELECTED, SYSTEM.RETURN.CODE)

Routine to return a list of keys from a select statement. Introduced to cater for a change of syntax in the READLIST statement from rev 5 to rev 6. The routine allows both versions of the syntax.

Parameter Description
SELECT.STATEMENT Execute statement (optional – select can be active)
KEY.LIST Id list returned, null if error
LIST.NAME Used as part of SAVE.LIST id
SELECTED Number of records selected
SYSTEM.RETURN.CODE @SYSTEM.RETURN.CODE after select statement

Example :

SELECTED.FILE = "F":MNEMO.COMPANY:".":"DX.ITEM.STATUS"

CMND = 'SELECT ' : SELECTED.FILE :' WITH CURR.APPLICATION = "DX.ORDER" '
CMND := 'AND CURR.STATUS = "FLL" '

CALL EB.READLIST(CMND,KEY.LIST,'',SELECTED,SYSTEM.RET.CODE)

This fills KEY.LIST variable with all keys coming from the SELECT.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.