IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

REXX EXECIO STEM No newline


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Harold Barnes

New User


Joined: 27 Oct 2015
Posts: 33
Location: United States

PostPosted: Tue Sep 17, 2019 6:07 am
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 477
Location: Denmark

PostPosted: Tue Sep 17, 2019 12:41 pm
Reply with quote

did you allocate using FILEDATA(TEXT)?
Back to top
View user's profile Send private message
Harold Barnes

New User


Joined: 27 Oct 2015
Posts: 33
Location: United States

PostPosted: Tue Sep 17, 2019 5:16 pm
Reply with quote

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
View user's profile Send private message
Harold Barnes

New User


Joined: 27 Oct 2015
Posts: 33
Location: United States

PostPosted: Tue Sep 17, 2019 6:05 pm
Reply with quote

FILEDATA(TEXT) was the solution.

Thanks!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts REXX - Adding variables CLIST & REXX 5
No new posts EDCICONV - Newline are missing All Other Mainframe Topics 6
No new posts Help this REXX Rookie-Bad arithmetic ... CLIST & REXX 7
No new posts passing stem variable with VPUT/VGET ... CLIST & REXX 6
This topic is locked: you cannot edit posts or make replies. REXX to find /* Define and write the ... CLIST & REXX 5
Search our Forums:

Back to Top