IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can we use PLISAXC parser for online program ?


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
swati1977

New User


Joined: 01 Aug 2012
Posts: 5
Location: India

PostPosted: Fri Sep 28, 2012 2:00 pm
Reply with quote

Hi ,
I just wanted to confirm if PLISAXC parser can be used for CICS transcation triggered Program/ Online program?

As per Manual, we can use it in for online process but recently I came across an issue where the following code was giving SOC4 . However, this code works fine in Batch program.

Code:
SAXCTEST: package exports(SAXCTEST);
define alias event                                     
     limited entry( pointer, pointer, fixed bin(31) ) 
     returns( byvalue fixed bin(31) )                 
     options( byvalue linkage(optlink) );             
.......
SAXCTEST:  procedure (InpPtr) options(reentrant,fetchable) reorder; 
/*necessary declaration for InpPtr is done */
 dcl 1 XMLMsg                   based(InpPtr),       
       3 XML_data(33)          char(32767);         
 XMLPtr   = addr (XML_data);     
 /* Here it fails when triggered through online .
     The reason is all GLOBAL  VARIABLES are STATIC
     and in CICS these are stored in Extended Readonly
      Dynamic Storage Area (ERDSA) . To overwrite this storage
      area is not allowed
*/         
call plisaxc (eventHandler,             
                     addr(token),             
                     addr(XML_data(1)),         
                     length(XML_data(1)));   
end SAXCTEST;

/* PARSER EVENT  HANDLER */
dcl XMLPtr                pointer ;       
dcl inpXML(33)         char(32767)     based(XMLPtr);
dcl arrCtr                   fixed bin(15)    init(1)        ;
dcl chars                    char(32000)     based         ;

start_of_document: proc(userToken)                     
                   returns( byvalue fixed bin(31) )   
                   options( byvalue linkage(optlink) );
                                                       
   dcl userToken      pointer;                                                                             
   return(0);                                         
end;

     
end_of_input:proc( userToken, addr_xml, length_xml ) 
                  returns( byvalue fixed bin(31) )         
                  options( byvalue linkage(optlink) );   
     dcl userToken      pointer;                         
     dcl addr_xml       byaddr pointer;                 
     dcl length_xml     byaddr fixed bin(31);           
                                                       
     arrCtr += 1;                                           
     if (arrCtr<=33) then do ;     
         addr_xml     = addr(inpXML(arrCtr));         
         length_xml  = length(inpXML(arrCtr));         
         return(0);                             
   end;
end;          /* Package end */
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Sep 28, 2012 3:02 pm
Reply with quote

And what happens if you declare XMLPtr explicitly as AUTO?
Back to top
View user's profile Send private message
swati1977

New User


Joined: 01 Aug 2012
Posts: 5
Location: India

PostPosted: Fri Sep 28, 2012 3:23 pm
Reply with quote

I made it AUTO and the following message was displayed during Compilation

Code:
IBM1863I S         11  Variables declared in a PACKAGE outside of any       
                       PROCEDURE must have the storage class STATIC, BASED or
                       CONTROLLED or must be DEFINED on STATIC.     
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Sat Sep 29, 2012 3:04 am
Reply with quote

Code:
SAXCTEST:  procedure (InpPtr) options(reentrant,fetchable) reorder;
/*necessary declaration for InpPtr is done */
 dcl 1 XMLMsg                   based(InpPtr),       
       3 XML_data(33)          char(32767);         
 XMLPtr   = addr (XML_data);     

Why do you need an extra XMLPtr when you already have InpPtr????
Back to top
View user's profile Send private message
swati1977

New User


Joined: 01 Aug 2012
Posts: 5
Location: India

PostPosted: Mon Oct 01, 2012 12:51 pm
Reply with quote

Thanks for the response Prino.

Due the following reasons I have used XMLPtr
> InpPtr is local to SAXCTEST procedure and cannot be accesed by the
event handlers like END_OF_INPUT
> XMLPTR is used in END_OF_INPUT to provide the remaining XML to
parser as the input is in form of arrary of 33 elements. When PLISAXC
was invoked I passed the address of Arr(1) hence remaining input is
expected by parser in end_of_input event.

Please correct me if my understanding is wrong.

Just out of curiosity, is there any other way to pass Input XML ,an array(33), can be passed to Parser ?
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Tue Oct 02, 2012 2:08 pm
Reply with quote

There are very significant gaps in your PL/I knowledge...

Why are you not using the array as a single entity?[/list]
Back to top
View user's profile Send private message
swati1977

New User


Joined: 01 Aug 2012
Posts: 5
Location: India

PostPosted: Tue Oct 02, 2012 5:14 pm
Reply with quote

I have tried sending array as single entity considering the fact that the data is in contiguous memory location. But in end_of_input I did not know how to increment the address since I did not have the address of start of array.

Is my understanding of scope of local variable insufficient ? Is it possible to use InpPtr for Parser ?

Let me know documents/links for above I can refer to enhance my knowledge.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Oct 02, 2012 6:01 pm
Reply with quote

You can surely get the address of the start of ther array very simply:
Code:
arr_addr = Addr(my_array);
?
Back to top
View user's profile Send private message
swati1977

New User


Joined: 01 Aug 2012
Posts: 5
Location: India

PostPosted: Wed Oct 03, 2012 12:11 pm
Reply with quote

Thanks Nic for your response.

Actually, I can pass the address of array to parser as mentioned however the parser fails . I have tried passing the full length of array and length of 1st element both .

sample below :
Case 1 : Address of array and full length of array (considering the fact that array data is in contiguous memory location): failed after invoking the pasrer

Error message :
start_of_document
exception return_code =0000000C, reason_code =000F3035, offset = 0

The message is not explainatory so I assumed it is due to length provided.
I reduced the length in CASE 2 below
Code:
call plisaxc (eventHandler,     
              addr(token),       
              addr(xmldocument),
              cstg(xmldocument));

In the above case i provided the start address of Array and complete length of array. Length is giving issue as it is on aggregate expression.

Case 2 :
Address of 1st element of array/ addr of array and length of 1st element in array. To continue parsing we need the address of rest of the array and thus I used the Global variable based on InpPtr . In the END_OF_INPUT trying to provided the next element in array until all input XML is processed.
This works fine in BATCH and FAILS in online process as mentioned in my 1st post .

Possible I have not understood the PLISAXC . It would nice if you clarify my understanding .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top