Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Can we use PLISAXC parser for online program ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Can we use PLISAXC parser for online program ?
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

Active Member


Joined: 07 Feb 2009
Posts: 984
Location: Oostende, Belgium

PostPosted: Fri Sep 28, 2012 3:02 pm    Post subject:
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    Post subject: Reply to: Can we use PLISAXC parser for online program ?
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

Active Member


Joined: 07 Feb 2009
Posts: 984
Location: Oostende, Belgium

PostPosted: Sat Sep 29, 2012 3:04 am    Post subject:
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    Post subject: Reply to: Can we use PLISAXC parser for online program ?
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

Active Member


Joined: 07 Feb 2009
Posts: 984
Location: Oostende, Belgium

PostPosted: Tue Oct 02, 2012 2:08 pm    Post subject:
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    Post subject: Reply to: Can we use PLISAXC parser for online program ?
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: 1715
Location: UK

PostPosted: Tue Oct 02, 2012 6:01 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm
No new posts Need points to tune IMS Checkpoint Pr... satish.ms10 IMS DB/DC 2 Fri Sep 30, 2016 4:12 pm
No new posts ISPF program to set SCRNAME prino TSO/ISPF 5 Fri Sep 30, 2016 2:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us