Question

I need to write a Progress 4gl program to parse input from STDIN so some processing and print the answer back to the screen.

e.g.

cat file_with_text.txt | $DLC/_progres -p .p | grep ...

  • Is this possible with the progress 4gl language?
  • If not possible with the language, please do not sugest buy this module from Progress. Just tell me it is not possible.
  • The version of progress is 10.1b.

I'm begening to think it is not possible. I will have to convince my managers we need to move away from Progress 4gl.

Was it helpful?

Solution

To elaborate:

/* cat.p
 *
 */

define variable xline as character no-undo.

do while true:
  import unformatted xline.
  put unformatted xline skip.
end.

And then run it like so:

_progres -1 -b -p cat.p < infile > outfile

or (for example):

cat cat.p | _progres -1 -b -p cat.p | grep unformatted

OTHER TIPS

1) It is possible using progress's "batch processing" mode. Look up "bpro" or "mpro -b"

2) Another possibility to consider is INPUT-OUTPUT THROUGH - this allows Progress to communicate with an external binary, and read it's output back as input. Also, OUTPUT THROUGH would send output to an external program's STDIN.

3) You want to dump Progress as a platform simply because it can't do piped I/O? That's not a good reason to move off a platform to something else which doubtless has other deficiencies relative to Progress.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top