I have a code in Informix 4gl that creates and writes to .4gl file. In short, it's code that generates a new program. It works perfectly in Informix:**
let p_output = p_prog clipped,".4gl"
start report rpt1 to p_output
output to report rpt1()
finish report rpt1
let run_stmt = "fglpc ",p_prog clipped
run run_stmt returning p_status
if p_status != 0 then
error " Program Compilation failed "
sleep 1
end if
end if
I'm trying to convert the code to Genero to create and write to a .4gl file.
let p_output = "vi ",p_prog clipped,".4gl"
let p_binoutput = p_prog clipped,".4gl"
LET ch_in = base.Channel.create()
CALL ch_in.openFile(p_binoutput,"w")
start report rpt1 TO p_output
output to report rpt1()
finish report rpt1
--let run_stmt = "fglpc ",p_prog clipped
let run_stmt = "fglcomp ",p_prog clipped
run run_stmt returning p_status
if p_status != 0 then
error " Program Compilation failed "
sleep 1
end IF
CALL ch_in.close()
end if
But I keep getting the error message in sqlca.sqlerrm:
p_prog.4gl: Permission denied.
or
vi p_prog.4gl: Permission denied
How can I fix this?