Question ID : 219
Created on 2013-11-21 at 9:00 AM
Author : Veryant Support [support@veryant.com]
Online URL : http://support.veryant.com/support/phpkb/question.php?ID=219
Piping can be used for files declared as:
a) a printer file (ASSIGN TO PRINTER)
b) a line sequential file (assuming to compile with -flsu)
In all other cases (relative file, binary sequential file etc) piping it is not allowed.
Here a simple program:
program-id. pipe.
environment division.
input-output section.
file-control.
select my-file assign to printer '-p sh -c cat>pipe.txt'.
data division.
file section.
fd my-file.
01 my-rec pic x(60).
procedure division.
main.
open output my-file.
write my-rec from "abcdefghijk".
write my-rec from "01234567890"
close my-file.
Some hints:
open output my-file.
write my-rec from "abcdefghijk" NO CONTROL.
write my-rec from "01234567890" NO CONTROL.
close my-file.
open output my-file.
write my-rec from "abcdefghijk" NO CONVERSION.
write my-rec from "01234567890" NO CONVERSION.
close my-file.
select my-file assign to printer '+p sh -c cat>pipe.txt'.