Automic Workload Automation

 View Only

 WRITE_PROCESS adding newline to end of file

Marshall Washburn's profile image
Marshall Washburn posted Feb 05, 2026 12:42 PM

Hello, I have the following code that's running in the post-process step of a SQL job. It's putting a newline at the end of the file being written on the server (OEL server) and the client is requesting it to be removed. I can try and manually add a step to remove it, but I was wondering if there was a way to toggle this off in Automic, or if this was intended at all.

!Grab the BJS server for the environment
:SET &agent# = GET_VAR('VARA.IT.&$CLIENT#',BANJOBS_SERVER,1)
!Grab the report which should have the SQL records
:SET &SQL# = PREP_PROCESS_REPORT()
:SET &RET# = WRITE_PROCESS(&SQL#,'<filename>.csv',&agent#,LOGIN.IT.BANJOBS,OVERWRITE)
:CLOSE_PROCESS &SQL#

:IF &RET# > 0
: SET &ERRNR# = SYS_LAST_ERR_NR()
: SET &ERRINS# = SYS_LAST_ERR_INS()
: SET &MESSAGE# = GET_MSG_TXT(&ERRNR#,&ERRINS#)
: SEND_MSG &$USER#, &$DEPARTMENT#, &MESSAGE#
:ENDIF

Thank you for any help,

 - Marshall Washburn

Peter Grundler's profile image
Broadcom Knight Peter Grundler

Hi Marshall.

please check the raw report: in the SQL tab change "Job Report - Store to file". Then run your job and open the report file (Oxxxx.txt) created in the temp folder of the agent.

On my system the original report is the same as the file created by WRITE_PROCESS.

regards,
Peter

Eric Lontz's profile image
Eric Lontz

Marshall,

This could also be a setting in your sql agent ini. About line 137 there is newline=1 this is the default setting which add a new line to the end of the report. If it is set to newline=1 then update it to newline=0 and restart the agent. This should remove the empty line.