COMPRESS ‘cat /transfer/arquivo > /transfer/saida’ INTO #CMD
CALL ‘shcmd’ #CMD
Nothing happens. The SPod doesn’t return anything.
Is it possible to execute commands like “echo”, “vi” and “cat”, from a natural program in the natural single point?
Hi Naira
There is no possibility I’m afraid.
If you run under SPoD you do not have a terminal on the server.
The Natural IO, which usually is routed to the terminal, is intercepted by SPoD and sent back to the client for displaying. But it is not possible to intercept the data the shell routes directly to the terminal.
May be it is an option to upload/download the file with Entire Connection:
0040 DEFINE WORK FILE 1 '/tmp/aaaa' TYPE 'ASCII'
0050 DEFINE WORK FILE 2 TYPE 'TRANSFER'
0060 INPUT 'a'
0070 SET CONTROL '+'
0080 READ WORK FILE 1 REC
0090 DOWNLOAD PC 3 REC
0100 END-WORK
Now edit the file on PC and upload the data.
An other approach could be to process the file editing using a Natural program
0050 DEFINE WORK FILE 1 '/tmp/aaaa' TYPE 'ASCII'
0060 READ WORK FILE 1 REC(I)
0070 ADD 1 TO I
0080 END-WORK
0090 CLOSE WORK 1
0100 /* input processing
0110 FOR I 1 100
0120 WRITE WORK 1 REC(I)
0130 END-FOR
What’s the content of RET(“SHCMD”) after your call?
Maybe the natural-process doesn’t have the right to write into directory /transfer. To find this out, please redirect the Error-Output of your command into a separate file. Like this: