Post by shawnturner12 on Jan 8, 2018 0:04:59 GMT -5
My program (fmtest3.txt) at this moment can detect in which copybook to write based on the attribute given. I've made sections vul-fm001 and vul-fm002 to fill the appropriate copybooks. But now this is the problem. How can I write a move statement that uses the tagname as fieldname. Idealy I would have something like MOVE XML-text to 'field-name' in FM00x.
I could, of course use an IF-statement and use hard-coded field-names, but I want to make this more flexiable by using a variable for the field-name (and maybe also for the copybook-name) so I could code one MOVE-statement.
Seems to me that you are going to have to create a generic copy/move procedure, and then pass arguments, or pointers to an array of arguments, that provide source and target variables and well as a copy/move switch.
The actual statement constructs should be easy to figure out if you google them. Any programmer who doesn't have a google window or windows open all the time is either really good or really bad.
You should also find the Stack Overflow website and ask these kinds of questions there. I reference them quite a bit.