I have managed to generate an XML file using the XML GENERATE statement but for some reason when I try use the NAME or TYPE phrases, the program doesn't compile. I get an "Verb expected, NAME found" error. Am I missing a copycode or definition? Or do these only work on mainframe?
I have managed to generate an XML file using the XML GENERATE statement but for some reason when I try use the NAME or TYPE phrases, the program doesn't compile. I get an "Verb expected, NAME found" error. Am I missing a copycode or definition? Or do these only work on mainframe?
Can you provide the XML GENERATE statement that you are attempting to use?
Can you provide the XML GENERATE statement that you are attempting to use?
Variable definition:
01 EDMS-REC-TEMP PIC X(5000).
01 CNT-TMP PIC 9(4).
01 ADASystem.
02 Document.
05 Fields.
10 F_POLICY_NO PIC X(20).
10 F_ID_PASSPORT PIC X(20).
10 F_MEMBER_ID PIC 9(6).
10 F_FIRST_NAME PIC X(100).
10 F_MIDDLE_NAME PIC X(100).
10 F_LAST_NAME PIC X(100).
01 XML-DECLARATION
VALUE '<?xml version="1.0" encoding="iso-8859-8"?>' PIC X(43).
XML GENERATE EDMS-REC-TEMP FROM ADASystem
COUNT IN CNT-TMP.
STRING XML-DECLARATION DELIMITED BY SIZE,
EDMS-REC-TEMP
DELIMITED BY ' '
INTO EDMS-REC-DISK
WITH POINTER TXT-LEN.
WRITE EDMS-REC-DISK.
This works great but I have to hard-code and string the declaration in as the "WITH XML-DECLARATION" clause doesn't compile.
The XML generated looks like this:

But I wanted to try use the NAME and TYPE statements in order to achieve this:

Would this be possible?
Variable definition:
01 EDMS-REC-TEMP PIC X(5000).
01 CNT-TMP PIC 9(4).
01 ADASystem.
02 Document.
05 Fields.
10 F_POLICY_NO PIC X(20).
10 F_ID_PASSPORT PIC X(20).
10 F_MEMBER_ID PIC 9(6).
10 F_FIRST_NAME PIC X(100).
10 F_MIDDLE_NAME PIC X(100).
10 F_LAST_NAME PIC X(100).
01 XML-DECLARATION
VALUE '<?xml version="1.0" encoding="iso-8859-8"?>' PIC X(43).
XML GENERATE EDMS-REC-TEMP FROM ADASystem
COUNT IN CNT-TMP.
STRING XML-DECLARATION DELIMITED BY SIZE,
EDMS-REC-TEMP
DELIMITED BY ' '
INTO EDMS-REC-DISK
WITH POINTER TXT-LEN.
WRITE EDMS-REC-DISK.
This works great but I have to hard-code and string the declaration in as the "WITH XML-DECLARATION" clause doesn't compile.
The XML generated looks like this:

But I wanted to try use the NAME and TYPE statements in order to achieve this:

Would this be possible?
NAME isn't a reserved word, you could compile using -Rw TYPE and see if that helps.
NAME isn't a reserved word, you could compile using -Rw TYPE and see if that helps.
I am not able to change the compile config.
Does this mean that the XML GENERATE does not work in ACUCOBOL? As I am unable to specify element names and types.
I am not able to change the compile config.
Does this mean that the XML GENERATE does not work in ACUCOBOL? As I am unable to specify element names and types.
The original post showed that compiling using F_POLICY_NO did work. I cannot think of how to make an FD where you use FIELD NAME=" F_POLICY_NO"
I am not able to change the compile config.
Does this mean that the XML GENERATE does not work in ACUCOBOL? As I am unable to specify element names and types.
I'm sure you could transform the output using XSLT. There are plenty of guides online on how to use XSLT.
I'm sure you could transform the output using XSLT. There are plenty of guides online on how to use XSLT.
Thank you so much for the feedback. I will try get it working using C$XML rather. The XML GENERATE is such a nifty tool, it would've been great if I could've got it to work.
For info, this is what I was referring to wrt the NAME and TYPE statements:

This was from the IBM docs (https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/lr/ref/rlpsxmlg.html)
Thanks again for your assistance.
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.