Open System Services Porting Guide (G06.24+, H06.03+)

Table Of Contents
Interoperating Between User Environments
Open System Services Porting Guide520573-006
4-17
Editing Files From TACL
Moving Files From the Guardian Environment to the OSS
Environment
You may access EDIT-format files directly from the /G file system with an OSS utility.
Three options for moving files to the OSS environment are provided:
The following command copies and converts the EDIT file (type 101) called
$DATA01.REPORTS.JAN94 to the OSS file (type 180) /home/stu01/report in
the correct OSS format:
cp /G/DATA01/REPORTS/JAN94 /home/stu01/report
It is possible to read EDIT files into your current OSS workspace for vi or ed. In
the following command sequence, ed creates the /home/stu01/report file.
(This sequence is also possible for vi.)
rm /home/stu01/report
ed /home/stu01/report
r /G/DATA01/REPORTS/JAN94
w
q
In the second command line, /home/stu01/report is automatically created
when starting the ed utility. The r command reads the Guardian file
$DATA01.REPORTS.JAN94 into the ed workspace. When the w command is
executed, the contents of the workspace are written to the /home/stu01/report
file. The /home/stu01/report file is then in standard. The q command
terminates ed.
If the report file does not exist, you do not need to use the rm utility (the first
command line in this example).
You can edit a type 180 file in the Guardian environment directly from the OSS
environment, but only with type 180 files:
gtacl -p EDITTOC \$DATA01.REPORTS.JAN94,
\$DATA01.REPORTS.TEMP
vi /G/DATA01/REPORTS/TEMP
Moving Files From the OSS Environment to the Guardian
Environment
An ASCII text file in OSS format can be created in the Guardian environment by almost
any OSS utility: cp, vi, ed, cat, grep, or awk. Many Guardian utilities can process
the OSS file format correctly, giving it a type of 180. (Some Guardian utilities or
programs can require the EDIT-file format: type 101.)
The following example of the cp utility creates a file in OSS format:
cp /home/stu01/report /G/data01/reports/temp2