Consultor Eletrônico



Kbase P130918: How to use an external filter command to process data in a MEMPTR variable?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

GOAL:

How to use an external filter command to process data in a MEMPTR variable?

GOAL:

How to compress MEMPTR data using an external program on Unix?

GOAL:

How to use gzip to compress data in a MEMPTR variable?

FACT(s) (Environment):

UNIX
OpenEdge 10.x

FIX:

The COPY-LOB statement can be used efficiently to exchange data with the filesystem and other commands. Here is an example of how to use gzip to compress data in a MEMPTR variable:
procedure compressProc:
def input param xxx as memptr no-undo.
def output param yyy as memptr no-undo.
def var tmpf as char no-undo.
def var cmd as char no-undo.
input through mktemp.
import unformatted tmpf.
input close.
copy-lob xxx to file tmpf no-convert.
cmd = "gzip " + tmpf.
os-command value(cmd).
tmpf = tmpf + ".gz".
copy-lob file tmpf to yyy no-convert.
cmd = "rm " + tmpf.
os-command value(cmd).
end.