Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: How to build the o/p from PLISAXC

62 views
Skip to first unread message
Message has been deleted

Robert AH Prins

unread,
Apr 17, 2012, 9:10:19 AM4/17/12
to
On 2012-04-17 10:44, JK wrote:
> HI,
>
> I want to parse the XML string, I am using PLISAXC. Since I am using
> batch program, it is writing the output in spool area.
> I want to build output in the copybook format. i.e. value of
> content_characters should be moved to variable in the copybook.
>
> e.g.:
> I am getting the output like below in the spool.
> start_of_element<NetAmt>
> content_characters<2000.00>
> !!flags = 01000000
> end_of_element<NetAmt>
>
> I want to move the value 2000 to the variable "NetAmt" in the copybook.

From someone who works at Den Danske Bank, I (OK, fresh from the S0C1
debacle...) would have expected to provide us with a bit more
information. Data doesn't just end up in the spool all by itself, but it
does do so when you blindly copy the example given in the manual, and
given the extreme similarity of your output and the output of the
example in "Enterprise PL/I for z/OS Programming Guide", (and I'm
looking at page 493 (PDF: 529)) that is exactly what you seem to be doing.

Robert
--
Robert AH Prins
robert(a)prino(d)org
Message has been deleted

Robert AH Prins

unread,
Apr 17, 2012, 12:23:39 PM4/17/12
to
On 2012-04-17 13:16, JK wrote:
>> looking at page 493 (PDF: 529)) that is exactly what you seem to be doing..
>
> As you said, I copied the program from the programing guide, since it
> has put skip statement, the output is displayed in the spool. I don't
> have any issue with the output displayed in the spool.
> As I said earlier, I am parsing the XML document/string using
> PLISAXC.
> My question: Is that possible to parse the value, and build the output
> in the copbook structure?

Why are you posting here? Shouldn't you go back to school to actually
learn PL/I? *Does your employer know that you do not have the PL/I
knowledge required to do your job?*

JK

unread,
Apr 17, 2012, 10:39:45 AM4/17/12
to
> robert(a)prino(d)org- Hide quoted text -
>
> - Show quoted text -

I appreciate your reply. Also I agree that you are the best PL/1
developer in the world.

Jessica Colman

unread,
Apr 24, 2012, 12:50:54 PM4/24/12
to
Hello,

I understand you want to populate a PL/I structure with the contents of
a XML string. The following example is by Peter Elderon who presented it
at a GUIDE/SHARE some years ago. You only need 3 LIMITED ENTRYS of the
event handler structure. At the end, fill in the name of the structure
you want to populate. The example works exactly in the reverse way as
XMLSTRING.

HTH
Jessica

<cut>
dcl I bin fixed(15);
dcl path char(133) varying init('');

dcl xmlDocument char(32000) init(' ');

eventHandler.e07 = my_start_of_element;
eventHandler.e12 = my_end_of_element;
eventHandler.e15 = my_content_characters;

call plisaxa( eventHandler,
addr(path),
addrdata(xmlDocument),
length(trim(xmlDocument)));
<cut>

my_start_of_element:
proc( userToken, xmlToken, TokenLength )
returns( byvalue fixed bin(31) )
options( byvalue linkage(optlink) );

dcl userToken pointer;
dcl xmlToken pointer;
dcl tokenLength fixed bin(31);

dcl path char(133) varying based(userToken);
dcl chars char(32000) based;

if (length(path) > 0)
then
path !!= '.';

path !!= substr(xmltoken->chars, 1, tokenlength);

return(0);
end;
my_end_of_element:
proc( userToken, xmlToken, TokenLength )
returns( byvalue fixed bin(31) )
options( byvalue linkage(optlink) );

dcl userToken pointer;
dcl xmlToken pointer;
dcl tokenLength fixed bin(31);

dcl path char(133) varying based(userToken);

if (length(path) = tokenlength)
then
path = substr(path, 1, length(path) - tokenlength);
else
path = substr(path, 1, length(path) - (tokenlength + 1));

return(0);
end;
my_content_characters:
proc( userToken, xmlToken, TokenLength )
returns( byvalue fixed bin(31) )
options( byvalue linkage(optlink) );

dcl userToken pointer;
dcl xmlToken pointer;
dcl tokenLength fixed bin(31);

dcl path char(133) varying based(userToken);

dcl chars char(32000) based;

dcl dataString char(1024);

dataString = path
!! ' = '''
!! substr(xmltoken -> chars, 1, tokenlength)
!! ''';';

get string(dataString) data (<fill in structure name here>);

return(0);
end;

Am 17.04.2012 12:44, schrieb JK:
> HI,
0 new messages