0

It is very rare to find any help for U2 Unidata/Universe database and searches online are not much of a help. So I am trying to make dynamic field change (based on input):

OPEN FILE.NAME TO WORKING.FILE ELSE STOP
READV FIELD_VAR FROM WORKING.FILE,RECORD.ID,FIELD.LOCATION THEN
   PRINT FIELD_VAR
END ELSE
   PRINT "No records found"
END
CLOSE WORKING.FILE

Problem is user executing this program don't know field location, field location could be 10, could be 5, could be any number (except 0 which is ID). I've been reading rocket documentation and I cannot find anything similar. Closest I've got was with writing query that looks like this:

SELECT DICT WORKING.FILE WITH @ID EQ 'FIELD.NAME'
LIST DICT WORKING.FILE LOC or ELE DICT WORKING.FILE where 2nd line shows location

This is a workaround that I just have to translate into code but I hope that there is something much easier then this.

zuboje
  • 696
  • 3
  • 11
  • 28
  • Are you asking them to enter the field number or field name (as it appears in the dictionary)? – Tim the Enchanter Nov 19 '16 at 14:33
  • @TimtheEnchanter I am asking user to enter field name (they would never know location) and I would like to get based on field name location of that field from dictionary so I can use READV function. Does this make sense? – zuboje Nov 19 '16 at 19:54
  • I do not understand your question. if the user gives you the field name that they want why don't you read in the dictionary item? Note you would have to check type and if it is a D-Type then get the location. – Mike Dec 07 '16 at 18:42
  • @Mike That is what I have ended up doing, reading from dictionary and then checking type – zuboje Dec 09 '16 at 14:20

0 Answers0