View previous topic :: View next topic
|
Author |
Message |
Harold Barnes
New User
Joined: 27 Oct 2015 Posts: 33 Location: United States
|
|
|
|
I'm writing to a USS file using EXECIO with STEM out.
The data is written but without the x'15' at the end of each line.
I tried concatenating a '15'x to the end of each stem variable but it still doesn't get written to the output.
Suggestions?
Using syscall works but I was hoping to find an EXECIO solution. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
did you allocate using FILEDATA(TEXT)? |
|
Back to top |
|
|
Harold Barnes
New User
Joined: 27 Oct 2015 Posts: 33 Location: United States
|
|
|
|
Code: |
bb.0 = 7
do i = 1 to bb.0
bb.i = bb.i || '15'x
say bb.i
end
"ALLOC FI(OUTDD) PATH('/u/uuuuu/BB/bb.out.bin') " ,
" PATHDISP(KEEP,DELETE) PATHOPTS(ORDWR,OCREAT) " ,
" PATHMODE(SIRUSR,SIWUSR) " ,
" FILEDATA(BINARY) "
"EXECIO * DISKW OUTDD ( FINIS STEM bb."
"FREE FI(OUTDD"
call syscalls 'ON'
address syscall
path='/u/uuuuu/BB/bb.out.txt'
'open' path,
O_rdwr+O_creat+O_trunc,
660
if retval=-1 then
do
Say 'file not open, error codes' errno errnojr
return
end
fd = retval
do j = 1 to bb.0
rec = bb.j
'write' fd 'rec' length(rec)
if retval=-1 then
do
say 'record not written, error codes' errno errnojr
'close' fd
exit 99
end
end
'close' fd
exit 0
|
I've tried:
FILEDATA(BINARY)
FILEDATA(TEXT)
FILEDATA(RECORD) |
|
Back to top |
|
|
Harold Barnes
New User
Joined: 27 Oct 2015 Posts: 33 Location: United States
|
|
|
|
FILEDATA(TEXT) was the solution.
Thanks! |
|
Back to top |
|
|
|