Skip to content

Instantly share code, notes, and snippets.

@BirgittaHauser
Last active September 4, 2022 14:04
Show Gist options
  • Save BirgittaHauser/f28e3527f1cc4c422a05eea865b455bb to your computer and use it in GitHub Desktop.
Save BirgittaHauser/f28e3527f1cc4c422a05eea865b455bb to your computer and use it in GitHub Desktop.
Scan through all spoolfiles in a specific outqueue
-- Scan through all spoolfiles in a specific outqueue (e.g. QEZJOBLOG) for a specific string
Select a.Job_Name, Spooled_File_Name, File_Number, Spooled_Data
-- , a.*
from OutPut_Queue_Entries a Cross Join
Lateral(Select *
From Table(SysTools.Spooled_File_Data(
Job_Name => a.Job_Name,
Spooled_File_Name => a.Spooled_File_Name,
Spooled_File_Number => File_Number))) b
Where Output_Queue_Name = 'QEZJOBLOG'
and Spooled_Data like '%WhateverYouWant%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment