Hi S K. RPG does not allow for the use of soft coded field names. In the past, I wrote a program that used the DSPFFD output from a file and allowed me to map it to another file. The fields did not have to be in the same order, but they did have to be the same length. Anyway, the program used two MODS to hold the from, to, type, etc stats of the two files, and I would type in the MAP to field from the second file. The program used MOVE, MOVEL, EVAL etch to do the match up, based on my input of justification. I no longer have that code, but it should be fairly easy to replicate from scratch if you have time. -Mean 1
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
Softcoded field names
Collapse
X
-
Softcoded field names
S K, The thing you will find with SQL is that dynamic input is very easy to define with a prepared statement. The output side, which is what I believe you are after, is more difficult. The only way I know of to vary the output target with SQL is to use an SQLDA. The open source DYNSQL module that is part of the iSeries-toolkit simplifies that type of processing. You might check out the Dynamic SQL examples. The last example shows how to build a physical file from an SQL statement. I am working on a command wrapper for that procedure right now. David Morris
Comment
-
Softcoded field names
I am trying to develop an application to map data from one data file into a target file. I don't want to hardcode the target field names into the RPG, instead holding them in a definition file. I can't find a way of doing this. Any ideas? Any suggestions would be appreciated
Comment
Comment