can you give some more information ? I'm not familiar with Lyant RM?COBOL-85, but as far as i know COBOL doesn't support variable length fields (indentifiers), so the number of bytes an identifier occupies can always be worked out by its definition / picture.
I have a field defined like PIC X(8), and this field is the name of a file that I want to create in Unixware, with an extension (PIC X(4)) giving by the program.
The problem is that if the length of the file name is less than 8, then an error occur in the command line of the Unixware, because the command line is incorrect.
EXAMPLE:
File Name: XPTO
File Extention: .TXT
Command Line: cp XPTO .TXT
I want it to be:
File Name: XPTO
File Extention: .TXT
Command Line: cp XPTO.TXT
Poliv,
Use the string command to construct your command line:
file-name pic x(8).
file-exten pic x(4).
command-line pic x(80) value spaces.
string "cp " delimited by size, file-name delimited by " ",
"." delimited by size,
file-exten delimited by space into command-line.
Call "unix" using command-line.
(The 'delimited by" phrase stops the transfer of bytes into the receiving field.)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.