Definitely a good question!
If you did need to read from a spooled file, you could do it as shown below. Satid has made a great point though. If you took an approach of generating spooled output and then reading it, you could end up generating a lot of spooled files in the system.
--Description: read the contents of a spooled file
SELECT *
FROM TABLE (
SYSTOOLS.SPOOLED_FILE_DATA(
JOB_NAME => '000000/USERPRF/JOBNAME', SPOOLED_FILE_NAME => 'SPLFNAME', SPOOLED_FILE_NUMBER => 1)
);
------------------------------
Steven Riedmueller
Certified IBM i Admin
Speaker, Mentor, and Advocate
------------------------------
Original Message:
Sent: Thu January 18, 2024 04:27 AM
From: Thomas Varkey
Subject: ACS - Run SQL Scripts CL output display
Dear Satid,
I was just curious why there was no output displayed, when the command executed without error. Your explanation however makes sense. Thank you for your reply.
------------------------------
Thomas Varkey
Original Message:
Sent: Thu January 18, 2024 01:57 AM
From: Satid Singkorapoom
Subject: ACS - Run SQL Scripts CL output display
Dear Thomas
CL's OUTPUT(*) does NOT work in Run SQL Script session from its beginning. Instead, it produces the resulting screen as a spooled file. I remember Scott Forstie posted SQL technique for displaying the content of a spooled file in IBM i SQL session but I do not remember wherher it will work with Run SQL Script or not. But this method can cause a proliferation of spooled files that consume disk space if many people will use it a lot. So, if you have a compelling reason to use OUTPUT(*), use a 5250 session.
------------------------------
Chance favors only the prepared mind.
-- Louis Pasteur
------------------------------
Satid S.
Original Message:
Sent: Wed January 17, 2024 06:38 AM
From: Thomas Varkey
Subject: ACS - Run SQL Scripts CL output display
Hello ,
From ACS Run SQL Scripts, if I run a CL command , is there a way to get the output displayed.
For eg
cl:DSPJOBLOG OUTPUT(*); is successfully executed but no output displayed. Are there any additional preferences to be set.
I am on ACS v1.1.8.8 (a slightly old version )
![](https://dw1.s81c.com//IMWUC/MessageImages/08d4a11d69f9474db3858c2d9b7c94ef.png)
Any advice would be appreciated.
------------------------------
Thomas Varkey
------------------------------