Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enterprise COBOL for z/os v3.3 - use of XML statements

Status
Not open for further replies.

Yordaman

Technical User
Dec 18, 2000
27
GB
I am doing some investigative work with regard to using (or not) the new XML features of the latest COBOL compiler.

I have seen examples of v3.2 and the use of the 'XML PARSE' statement, but as yet I cannot find the exact format nor examples of the advertised 'XML GENERATE' statement.

Has anyone any helpful examples or links to such locations that have some, please?

Thanks,
 
...nobody answered (sofar)...
I have no(!) knowledge of COBOL releases past the COBOL-85 standard. But, the following information might help you to search the internet to find your answer:

A BRIEF XML HISTORY

XML is both(!) a subset aswell as an extension of SGML.
HTML is an application of SGML.


SGML - Structured General Markup Language - was developed by IBM in the early seventies.
It was intended as a general markup language for distributing and printing documentation and books.
It was adopted and used by the printing industry to do just that.
Over the years the SGML was extended and expanded by many, many, many new markup commands.

SGML (like XML) consists of 2 parts a DTD and the marked up document itself.
The DTD - Document Type Definition - describes the structure and (valid) markup commands.
The document itself must(!) contain this structure - otherwise it is not valid - and can(!) only use the markup commands defined in the DTD.
There are universal standerdised DTD's. But you can also define your own DTD. This makes SGML very flexible.

The DTD of HTML is 'baked' into the browser and cannot be changed. Therefore this DTD is fixed and inflexible. Thus HTML is a hardcoded browser implemetation (A built-in hardcoded SGML DTD is also known as a SGML application).

XML went back to the roots again - that is brought the SGML flexibility back into the internet applications. However SGML was (and is) a monster and way to heavy for the internet. The creators of XML only took a subset of SGML to keep it lean and mean. However, the internet has capabilities that were not present and/or known in the early seventies, such as: pictures, sound, animations and video. These options were added to this subset of SGML. The whole - the SGML subset plus the extensions - is called XML.

Besides its value for the internet XML is also valuable to define and organise your data independent from your used hardware, application or database. Just keep in mind that it does not - nor is it intended - to replace your (software) platform or database.


Regards, Wim Ahlers.
 
For an example of using XML to structure your data see:

Using the problem stated on this post then the DTD would include a structure similar to the following:
Code:
<xs:schema xmlns:xs="[URL unfurl="true"]http://www.w3.org/2000/10/XMLSchema">[/URL]

     <xs:annotation>
          <xs:documentation>
          A sample XML schema based on the problem stated as above.
          </xs:documentation>
     </xs:annotation>

     <xs:element name="NameFull" type="NameFullType"/>

     <xs:complexType name="NameFullType">
          <xs:sequence>
               <xs:element name="NameTitle" type="xs:string" minOccurs="1" maxOccurs="1" />
               <xs:element name="NameFirst" type="xs:string" minOccurs="1" maxOccurs="unbounded" />
               <xs:element name="NameMiddle" type="xs:string" minOccurs="0" maxOccurs="1" />
               <xs:element name="NameLast" type="xs:string" minOccurs="1" maxOccurs="unbounded" />
               <xs:element name="NameSub" type="xs:string" minOccurs="1" maxOccurs="unbounded" />
          </xs:sequence>
     </xs:complexType>

</xs:schema>
Note(!): I am not a DTD expert! No doubt this DTD is not 100% correct!


Regards, Wim.
 
Oops...!
The last example contained the scheme!
Here is the DTD:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE NameFull [
     <!ELEMENT NameFull (NameTitle,NameFirst+,NameMiddle?,NameLast+,NameSub+)>
     <!ELEMENT NameTitle (#PCDATA)>
     <!ELEMENT NameFirst (#PCDATA)>
     <!ELEMENT NameMiddle (#PCDATA)>
     <!ELEMENT NameLast (#PCDATA)>
     <!ELEMENT NameSub (#PCDATA)>
     ]>

<NameFull>
     <NameTitle></NameTitle>
     <NameFirst></NameFirst>
     <NameMiddle></NameMiddle>
     <NameLast></NameLast>
     <NameSub></NameSub>
</NameFull>


Regards, Wim.
 
Wim,

Thanks for your replies, but unfortunately I think you're a bit off track on the subject matter.

I was after examples of COBOL programs that make use of the latest features of the Enterprise COBOL for z/os v3.3 compiler, specifically those that support XML, such 'XML PARSE' and 'XML GENERATE'.

I have since got hold of the IBM manuals and have a good idea of the statement format, but any examples of real use, hints, tips, etc, would still be appreciated.

All this stuff about other forms of mark-up language is probably a good answer, but to a different question.

Thanks anyway,
 
I understood your problem. I only provided some background information to (possible) give you some new search arguments.

The other 'stuff' - the scheme and DTD - is actually more related to the other problem posted on the other forum site.
I used it in your post to give you - again - some additional search arguments.

It is probably a bit overdone.
Sorry for side tracking.


Regards, Wim.
 
Yordaman,
(I was away at SHARE, the IBM user group last week - so I missed the beginning of this). Certainly you deserve an answer to your actual question <G>.

The IBM documentation on XML GENERATE (that you may or may not have seen) with their example following is at:



What you REALLY might find useful is the presentation

"XML, COBOL and Application Modernization"

which can be viewed at:


but ONLY if you are a SHARE member. If you are not a SHARE member, send me a private email at:
wmklein <at> ix.netcom.com
and I'll ask the author if I can send you a copy.

Bill Klein
 
Hi Yordaman,

Did you get done with XML GENERATE? If 'Yes', I may need your program for reference.

Thanks,
 
Yordaman, I wonder if this XML GENERATE will take care of OCCURS clause in COBOL data structure.
or
Do we need to handle it manually, may be nested XML GENERATE?

I'm trying this for the first time with Enterprise COBOL.

Also please let me know what are the other practical considerations other than the IBM doc talks about, if any?

Thanks,
Kumaresh
 
Kumaresh,

I've got further in that we have successfully deployed v3.2 of Enterprise COBOL and got XML PARSE working fine - it's brilliant.

I have asked our operations area to acquire v3.3 so we can use XML GENERATE. This is now on-site and we should have installed (for general development use) mid-year. When available, I will have more information on exactly how this statement is used, etc.

Cheers,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top