PxPlus User Forum

Twitter Twitter Twitter

Recent Posts

Pages: 1 [2] 3 4 ... 10
Web Services / Re: Setup EZWeb server on RedHat Linux 8.x Server
« Last post by nmartinez@bristolind.com on August 16, 2022, 02:39:02 AM »
Hi Mike,
I am using Microsoft Edge browser to test a simple program based on your example above but modified to read one of our files.  We are getting the following error message as soon as we type

Do you know why we may be getting this error?
Thank you!

Error message starts after next line
Error has occured:
! ERR=12, CTL=0, RET=2
! **********************************************************
! Level=1
! PGN="/pxplusweb/lib/_plus/apache/pxp_cgi"
!  Statement......0585
! ----
! Global variables (%...)
DIM %args$[1:1]
%HTTP_ACCEPT_ENCODING$="gzip, deflate"
%HTTP_USER_AGENT$="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36 Edg/104.0.1293.54"

Web Services / Re: Setup EZWeb server on RedHat Linux 8.x Server
« Last post by nmartinez@bristolind.com on August 15, 2022, 09:23:23 PM »
You are awesome!!  Thank you Mike! :)
Programming / Re: Embedded IO procs/RDB
« Last post by ChrisKCAi on August 15, 2022, 04:21:24 PM »
Well, it wouldn't be the first time I made no sense  ;)
Although we do currently use embedded IO to facilitate replicating data to relational databases, that is governed by an on/off parameter within our software.
We would force that parameter "off" when using a prefix file so we can take advantage of the rest of the embedded IO logic.
We will just add it to the additional options on the conversion utility panel when updating the prefix file.

Programming / Re: Embedded IO procs/RDB
« Last post by Mike King on August 15, 2022, 03:34:40 PM »
The Database convert utility does not bring across the IO program into the option string.

We don't just assume that the IO program would apply since quite often the IO program is used for data replication onto a database.  Including this type of logic when migrating to a relational database makes no sense.
Programming / Re: Embedded IO procs/RDB
« Last post by ChrisKCAi on August 15, 2022, 03:25:50 PM »
Thanks for the reply - I'll dig in a little deeper then. Related question, if I use the database conversion utility in the data dictionary to update a prefix file, will it include the IOPROG= option if the IO proc is specified in the data dictionary definition?
Programming / Re: Embedded IO procs/RDB
« Last post by Mike King on August 15, 2022, 03:07:06 PM »
Using the SETDEV (nn) PROGRAM should work on a database, however since the file is already open there will not be any "Open" event which is often where a lot of the processing for embedded IO is done.

What I would suggest is that you use a PREFIX file to open the database and include a IOPROG=xxxxxx option in the Prefix file entry in order to have the IO program involved during the OPEN sequence.
Programming / Embedded IO procs/RDB
« Last post by ChrisKCAi on August 15, 2022, 02:59:01 PM »
We have made significant use of embedded IO procedures with the native file set. As we look to extend to using RDBs (like MSSQL), how can we leverage those embedded IO procedures? I thought maybe using SETDEV(chan)PROGRAM "MYPROC" after opening a table on <chan> would enable us to use the existing IO procs but that doesn't seem to work. Do we have to create database triggers that replicate our embedded IO? (Not even sure how we would do that but just looking for a direction).
Web Services / Re: Setup EZWeb server on RedHat Linux 8.x Server
« Last post by Mike King on August 15, 2022, 02:57:36 PM »
A lot here depends on what you trying to accomplish.  By default the web server will take you to an iNomads configuration page, however from what you described you don't need to use iNomads.

If all you are looking for is to create a web site that will respond to some programmed enquires, then you don't need to use iNomads.

To keep this simple what you can do is create a program with a .pxp suffix and the system will run it in response to a web request.  For example if you want to provide a process that responds to a web request with some part information you might make a program called "parts.pxp".  It can take the part number passed in from the URL and return the part description, Qty on hand, and price.  It would look something like this:

  OPEN (HFN,ERR=Failed) "path_to_part_file"
  READ (LFO,KEY=PartNo$,DOM=Failed) PartNo$,Description$,QtyOnHand,Price
  PRINT (%Print_fn) "AOK"
  PRINT (%Print_fn) Description$
  PRINT (%Print_fn) QtyOnHand
  PRINT (%Print_fn) Price
  PRINT (%Print_fn) "Failure:", MSG(err)

Now save that in the program as (parts.pxp) in the directory you are running your web server in.  If using EZWEB and you didn't specify a starting directory in the command line this will be the directory *plus/inomads.  We would suggest you change this by launching EZWeb passing the directory on the command line as follows:

  .../pxplus "*ezweb/server" -arg portNo "" starting_directory

So if you save parts.pxp in /home/myapp/website/parts.pxp your command to launch *EZweb might be:

  .../pxplus "*ezweb/server" -arg 8080 "" /home/myapp/website

Now once you have the server up you should be able to point a browser to:

Where the server ( is from the screen shot and details you posted and the XXXXXX is the partno$ value you want your program to receive. 

In response to this request you should have a screen that says "AOK" followed by the part information or "Failure" and the reason.

Now if you want to return the data as JSON (common for intra-application data exchanges) you could put the values you want to pass back into an associative array and use the DIM LIST directive to generate the JSON.  You would then output that to %PRINT_FN and change %CONTENT_TYPE$ to "application/json".

This gives you the basics of using the PxPlus Web server and should get you going.

Nomads / Re: Data dictionary maintenance error
« Last post by Mike King on August 15, 2022, 02:28:57 PM »
I would suggest you contact support as they probably can provide assistance.  They likely will need the error message/code displayed with the message along with your serial number to confirm what packages you have installed.
Nomads / Data dictionary maintenance error
« Last post by michaelgreer on August 15, 2022, 01:04:00 PM »
In the process of maintaining a dictionary we attempt to add a new element.  When we click Ok we get an "Error Occurred processing: "PERFORM *dict\Element;OKY_BTN".  The program is there and the label is too.  Ideas on what would cause this.  It is PVX 11.5 running under linux.  If I exit Nomads I can "call" that routine with no issue.
Pages: 1 [2] 3 4 ... 10