ISeries / AS400 FAQ : Programming : RPG : How can I locate a field's value by the field's name?

You can't do this in general in RPG (or any compiled language), but if the field is in an externally-described file, you can define an externally-described data structure for the file to get the fields in the same layout in the program as they are in the file. Then you can call the QUSLFLD API to find where that field is in the data structure. You can also use this technique to do generic processing on files.

For example, if you want to check several files to ensure that all zoned fields have valid data, you could use the program below. It uses a program described file, and calls QUSLFLD to find out the location and length of all the zoned fields in the file. Then it reads the file and checks the zoned fields in every record.

If you wanted to find a particular field or set of fields by name, rather than looking for type = 'S' as this program does, you'd look for the name you were interested in (subfield fieldName). More.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions