Kbase P25514: How to read or write to more than one file in the same proce
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/20/2003 |
|
Status: Unverified
GOAL:
How to read or write to more than one file in the same procedure
GOAL:
How to use STREAMS to open more than one file at time
FACT(s) (Environment):
Progress 8.x
FACT(s) (Environment):
Progress 9.x
FIX:
The following is an example using STREAMS:
DEFINE STREAM input1.
DEFINE STREAM input2.
DEFINE STREAM output1.
DEFINE STREAM output2.
DEFINE VARIABLE cValue AS CHARACTER NO-UNDO.
DEFINE VARIABLE cValue1 AS CHARACTER NO-UNDO.
INPUT STREAM input2 FROM <input-file-name-1>.
INPUT STREAM input1 FROM <input-file-name-2>.
OUTPUT STREAM output1 TO <output-file-name-1>.
OUTPUT STREAM output2 TO <output-file-name-2>.
REPEAT:
IMPORT STREAM input1 DELIMITER 'CHR(13)' cValue NO-ERROR.
IMPORT STREAM input2 DELIMITER 'CHR(13)' cValue1 NO-ERROR.
PUT STREAM output1 UNFORMATTED cvalue SKIP.
PUT STREAM output2 UNFORMATTED cvalue1 SKIP.
END.
INPUT STREAM input1 CLOSE.
INPUT STREAM input2 CLOSE.
OUTPUT STREAM output1 CLOSE.
OUTPUT STREAM output2 CLOSE.