You could use the stat() function from the integrated file system APIs.
The prototype definition looks like this:
D stat PR 10I 0 ExtProc('stat')
D path * Value Options(*string)
D buf Likeds(statDS)
Then you also need the stat data structure:
D statDS DS Qualified Template
D st_mode 10U 0
D st_ino 10U 0
D st_nlink 5U 0
D st_reserved2 5U 0
D st_uid 10U 0
D st_gid 10U 0
D st_size 10I 0
D st_atime 10I 0
D st_mtime 10I 0
D st_ctime 10I 0
D st_dev 10U 0
D st_blksize 10U 0
D st_allocsize 10U 0
D st_objtype 11A
D st_reserved3 1A
D st_codepage 5U 0
D st_ccsid 5U 0
D st_rdev 10U 0
D st_nlink32 10U 0
D st_rdev64 20U 0
D st_dev64 20U 0
D st_reserved1 36A
D st_ino_gen_id 10U 0
using it is pretty easy
D fileStats DS Likeds(statDS)
/free
if stat('/path/to/file': fileStats) < 0;
// error handling
endif;
// ccsid now in fileStats.st_ccsid
/end-free