Skip to content

Instantly share code, notes, and snippets.

@BirgittaHauser
Created August 15, 2022 07:06
Show Gist options
  • Save BirgittaHauser/2ac5b56cd7d763027ddb26ad6c687de9 to your computer and use it in GitHub Desktop.
Save BirgittaHauser/2ac5b56cd7d763027ddb26ad6c687de9 to your computer and use it in GitHub Desktop.
Scan though streamfiles
-- Search thourhg IFS files that include a specific text (sequence of characters)
-- In the following example the '/home/Hauser' directory is searched for streamfiles with the extender .json
-- All these streamfiles are searched for 'FirstName'.
-- All streamfiles including 'FirstName' are returned.
-- Attention: Get_CLOB_From_File must run under commitment control!
Select Path_Name, Get_Clob_From_File(Path_Name) "IFS File Content"
From Table (Qsys2.Ifs_Object_Statistics(Start_Path_Name => '/home/Hauser',
Subtree_Directories => 'YES',
Object_Type_List => '*ALLSTMF')) x
Where Right(Trim(Path_Name), 5) = '.json'
and Get_Clob_From_File(Path_Name) like '%FirstName%'
Order By Path_Name
With cs;
@spuentes
Copy link

Excelent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment