I am a systems developer on Microfocus Server Express 5.1, I tried to do the same thing I do in my programs but I always receive status code 35.
My program is an example of a cobol program calling a nodeJS program sending and receiving data.
I even tried using the "ls -l" command to list files in the folder and always the same error.
Below my program.
Your question was about communicating with pipe.
As far as I know, pipe is used to present data to a program by using the ACCEPT and DISPLAY verbs. The facility provides for using a file to retrieve or send records to or from a line sequential file.
For example, say you wish to pass a list of files to a program named PROG1. PROG1 would then open these files for whatever purpose it does. PROG1 would be executed from the command line
PROG1 0< FILELIST.TXT
A line sequential file named FILELIST.TXT would contain the list of files. It might look like this.
The following is info from the programmer's guide. You may find this info by doing a search for "PIPE" in the guide.pdf.
Pipe 0 is accessed by using an ACCEPT statement.
CONSOLE This is the (screen-mode) display of the PC or Unix system.
STDIN
SYSIN
SYSIPT
These devices (they are all synonymous) represent standard system input
(pipe 0). On a PC or UNIX system, this is typically the keyboard. The
contents of a file may be delivered to a GnuCOBOL program for access
via one of these device names by adding the sequence ‘0< filename’ to the
end of the programs execution command.
Pipe 1 and pipe 2 are accessed with a DISPLAY statement.
CONSOLE
PRINTER
STDOUT
SYSLIST
SYSLST
SYSOUT
These devices (they are all synonymous) represent standard system output
(pipe 1). On a PC or UNIX system, this is typically the display. Output
sent to one of these devices by a GnuCOBOL program can be sent to a file
by adding the sequence ‘1> filename’ to the end of the programs execution
command.
STDERR
SYSERR
These devices (they are synonymous) represent standard system error output
(pipe 2). On a PC or UNIX system, this is typically the display.
Output sent to one of these devices by a GnuCOBOL program can be sent
to a file by adding the sequence ‘2> filename’ to the end of the programs
execution command.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am a systems developer on Microfocus Server Express 5.1, I tried to do the same thing I do in my programs but I always receive status code 35.
My program is an example of a cobol program calling a nodeJS program sending and receiving data.
I even tried using the "ls -l" command to list files in the folder and always the same error.
Below my program.
Your question was about communicating with pipe.
As far as I know, pipe is used to present data to a program by using the ACCEPT and DISPLAY verbs. The facility provides for using a file to retrieve or send records to or from a line sequential file.
For example, say you wish to pass a list of files to a program named PROG1. PROG1 would then open these files for whatever purpose it does. PROG1 would be executed from the command line
PROG1 0< FILELIST.TXT
A line sequential file named FILELIST.TXT would contain the list of files. It might look like this.
NAMEMASTER.DAT
ADDRESSMASTER.DAT
PHONELIST.DAT
ENDOFLIST
Each file is on a line by itself. The CR LF on each record terminates an accept statement like the enter key does.
PROG1 would get the list one record at a time by doing an ACCEPT.
For example,
The following is info from the programmer's guide. You may find this info by doing a search for "PIPE" in the guide.pdf.
Pipe 0 is accessed by using an ACCEPT statement.
CONSOLE This is the (screen-mode) display of the PC or Unix system.
STDIN
SYSIN
SYSIPT
These devices (they are all synonymous) represent standard system input
(pipe 0). On a PC or UNIX system, this is typically the keyboard. The
contents of a file may be delivered to a GnuCOBOL program for access
via one of these device names by adding the sequence ‘0< filename’ to the
end of the programs execution command.
Pipe 1 and pipe 2 are accessed with a DISPLAY statement.
CONSOLE
PRINTER
STDOUT
SYSLIST
SYSLST
SYSOUT
These devices (they are all synonymous) represent standard system output
(pipe 1). On a PC or UNIX system, this is typically the display. Output
sent to one of these devices by a GnuCOBOL program can be sent to a file
by adding the sequence ‘1> filename’ to the end of the programs execution
command.
STDERR
SYSERR
These devices (they are synonymous) represent standard system error output
(pipe 2). On a PC or UNIX system, this is typically the display.
Output sent to one of these devices by a GnuCOBOL program can be sent
to a file by adding the sequence ‘2> filename’ to the end of the programs
execution command.
Did you have a look at :
https://sourceforge.net/p/gnucobol/contrib/HEAD/tree/trunk/tools/cobweb/cobweb-pipes/
Might be useful