MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Regarding XMLGEN in FileAid

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
dinesh
Beginner


Joined: 23 Mar 2004
Posts: 2
Topics: 1

PostPosted: Tue Mar 23, 2004 1:14 am    Post subject: Regarding XMLGEN in FileAid Reply with quote

I need to convert some data files to XML.I tried using XMLGEN in FileAid.
Though the job is going through fine with a return code of 0 the output member is empty.Is XML file format readable on mainframes??
The number of lines being written into the output member varies if I vary the input file and the coressponding copy book

Can someone help??

Thanks

Dinesh
Back to top
View user's profile Send private message
Sreejith
Intermediate


Joined: 02 Dec 2002
Posts: 155
Topics: 25
Location: N.Ireland

PostPosted: Tue Mar 23, 2004 3:54 am    Post subject: Reply with quote

The following JCL I use creates the XML file. The latest COBOL is having the ability to read XML file. But not suitable for large XML file.

Code:

//JS10     EXEC PGM=FILEAID,REGION=6M           
//SYSPRINT DD  SYSOUT=*                         
//SYSLIST  DD  SYSOUT=*                         
//DD01     DD  DSN=Your.inputfile,           
//             DISP=SHR                         
//DD01O    DD  DSN=here.you.will.get.xml.file,             
//             DISP=OLD                         
//DD01RL   DD  DSN=this.is.where.cobol.copybooks.are.kept,         
//             DISP=SHR                         
//SYSIN    DD  *                                 
$$DD01 XMLGEN  INVALID=HEX,OUT=0,LAYOUT=your-copybook,
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
SureshKumar
Intermediate


Joined: 23 Jan 2003
Posts: 211
Topics: 21

PostPosted: Tue Mar 23, 2004 8:00 am    Post subject: Reply with quote

Dinesh,
if you mean "readable" like a normal seq file, then the answer is yes. It would add the XML tags to the copybook layout specified against the data in a sequential manner...it would look similar to this...
<?xml version="1.0"?>
<FILE DSN="xxxxxxx.DSNTEP2.OUTPUT">
<(XX)-xxx-ACTION RECORD="00001">
<(XX)-xxx-ACTION></(XX)-xxx-ACTION>
<(XX)-xxxx-TRN-TMS></(XX)-xxxx-TRN-TMS>
<(XX)-xxx-USER-ID></(XX)-xxx-USER-ID>
<(XX)-xxx-CODE></(XX)-xxx-CODE>
<(XX)-xxx-INSERT-FLG></(XX)-xxx-INSERT-FLG>
<(XX)-xxxxx-xxxx-TRN-TMS></(XX)-xxxxx-xxxx-TRN-TMS>
<(XX)-xxxxxxxx-USER-ID></(XX)-xxxxxxxx-USER-ID>
<(XX)-xxxx-xxxx-NUM INVALID="HEX">X'404040404040404040404040404040'<
....
.....
Back to top
View user's profile Send private message
dinesh
Beginner


Joined: 23 Mar 2004
Posts: 2
Topics: 1

PostPosted: Wed Mar 24, 2004 3:22 am    Post subject: Reply with quote

The problem is the job runs fine but the output member is not readable.

The copy book I have used is:
Code:

01 LAYOUT.                                   
    05  NAME                       PIC X(07).
    05  FILLER                     PIC X(01).
    05  EMPNO                      PIC X(07).
    05  FILLER                     PIC X(01).
    05  AGE                        PIC X(02).

The JCL I have used is:
Code:

//XXXXXX JOB (XXXXX,1),'XML CONVERT',NOTIFY=&SYSUID,                 
//         MSGCLASS=Q,MSGLEVEL=(1,1),TIME=2,REGION=XX                   
//*  YOU ARE VIEWING JCL THAT FILE-AID 8.8 HAS GENERATED TO             
//*  PERFORM THE REQUIRED FUNCTION.                                     
//*                                                                     
//*  YOU CAN CHANGE THIS JCL IF DESIRED AND USE THE SUBMIT PRIMARY     
//*  COMMAND TO SUBMIT THE JOB. THE CREATE OR REPLACE PRIMARY COMMAND   
//*  CAN BE USED TO KEEP THIS JOBSTREAM FOR FUTURE USE.                 
//*                                                                     
//*  USE THE END COMMAND TO EXIT WITHOUT SUBMITTING THE JOB.           
//*                                                                     
//JS10     EXEC PGM=FILEAID,REGION=6M                                   
//STEPLIB  DD  DISP=SHR,DSN=XXX.XXX.XXX.XXX.XXXX               
//SYSPRINT DD  SYSOUT=*                                                 
//SYSLIST  DD  SYSOUT=*                                                 
//DD01     DD  DSN=XXXX.XXX.XXXXX.XXX,                             
//             DISP=SHR                                                 
//DD01O    DD  DSN=XXXX.XXX.XXXX.XXX.XXXX(OUT1),                 
//             DISP=OLD                           
//DD01RL   DD  DSN=XXXX.XXX.XXXX.XXX.XXXX.LAYOUT,
//             DISP=SHR                           
//SYSIN    DD  *                                 
$$DD01 XMLGEN  INVALID=DATA,OUT=0,LAYOUT=OUT2     
/*                                               

I tried with INVAID=HEX...but no use...


What could be the reason???
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Mar 24, 2004 4:56 am    Post subject: Reply with quote

Dinesh,

Where is OUT2 defined ? I don't see any out2 for the layout.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Apr 29, 2004 1:19 pm    Post subject: Reply with quote

Ravi,

You can write a cobol program to create a flat file from the xml file.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Apr 30, 2004 4:40 am    Post subject: Reply with quote

Ravi,

IBM Enterprise PL/I for z/OS and OS/390 Version 3 Release 1 provides a SAX-like event-based interface for parsing XML documents.The parser invokes an application-supplied handler for parser events, passing references to the corresponding document fragments.

The parser has the following characteristics:

  • It provides high-performance, but non-standard interfaces.
  • It supports XML files encoded in either Unicode UTF-16 or any of several single-byte code pages listed below.
  • The parser is non-validating, but does partially check well-formedness.


Check this link which has a detailed explanation of Using the SAX parser

Quote:

Wish there are any parsers. Whynot the FILEAID does the reverse.


I think it is partially due to the various encoding schemes involved.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Fri Apr 30, 2004 5:20 am    Post subject: Reply with quote

Hi,

remark for parsing XML / Reading XML using PL/1 programming language.

A few years ago i implemented an xml parser for PL/1. The parser works similar to IMS DB.

The application program calls an interface subroutine to generate XML Tokens like <text>.......</text>, so set or read values, to set the position in the XML script. The main idea is, that XML is like an tree, so commands like GetNext, GetPrevious are available like GN, GU, in IMS DB.

The implementation uses dynamic storage allocation and pointerstructures.

The uses this XML interface to send and receive data from / to SAP System.

bauer
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group