Hi there,
I'm trying to build a program to convert XML to COBOL copybooks. Don't want to have to use a separate converter. As I searched the web, I found many having the same problems I do.
Based on the example 'parsing an XML document one segment at a time' in the 'Enterprise COBOL for z/OS, V6.1 Programming Guide' (page 574), I've build a little program that interprets this XML-file fmtest3.xml
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.
Hope there's someone who can help.
Thanx in advance
Fons
Fonzie2405