You made an enquiery about getting a file size from a Unix ls -l statement, well it depends if tou want a specific file or the whole directory.
Below is a typical entry from a HP-UX ls -l command.
-rwxrwxw-rw- 1 dba users 1094 Jul 10 11:51 start.sh
As you can see it basically compirses of 9 white-space seperated columns, the file size being in column 5 and the file name in column 9. so to get the file size of that file this should work.
DEFINE VARIABLE w-in AS CHARACTER FORMAT "x(25)" NO-UNDO.
DEFINE VARIABLE w-size AS INTEGER NO-UNDO.
INPUT THROUGH "ls -l | grep 'start.sh'" NO-ECHO.
SET ^ ^ ^ ^ w-in.
INPUT CLOSE.
ASSIGN w-size = INTEGER(w-in).
That should give you the size of the file start.sh in the variable w-size. You will obviously have to replace the 'start.sh' operand of the Unix grep command with the name of the file you are looking for. If you wanted to collect the sizes of the whole directory along with the file names then the following example should provide your solution.
DEFINE VARIABLE w-in AS CHARACTER FORMAT "x(25)" EXTENT 2 NO-UNDO.
DEFINE TEMP-TABLE tt-info NO-UNDO
FIELD file-name AS CHARACTER
FIELD file-size AS INTEGER.
INPUT THROUGH "ls -l" NO-ECHO.
Process-Info:
REPEAT:
SET ^ ^ ^ ^ w-in[1] ^ ^ ^ w-in[2].
CREATE tt-info.
ASSIGN tt-info.file-size = INTEGER(w-in[1])
tt-info.file-name = TRIM(w-in[2]).
END.
INPUT CLOSE.
Assuming you were in the correct directory when you ran these examples you should have the info you want, in the case of the second example a complete list of all files with their sizes held in temp-table tt-info. This technique can be applied to any listing really with minor adaptations.
Note: The ^ (carat) character is used to skip a field that is not required to be imported.
I hope these examples will be of some help.
Rob.B.