Skip to content

Instantly share code, notes, and snippets.

@BirgittaHauser
Last active August 26, 2024 13:54
Show Gist options
  • Save BirgittaHauser/282b4f3f590da4b2774610b1b6ca7e58 to your computer and use it in GitHub Desktop.
Save BirgittaHauser/282b4f3f590da4b2774610b1b6ca7e58 to your computer and use it in GitHub Desktop.
List all Source Code Lines - for Scan
Select System_Table_Schema, System_Table_Name, System_Table_Member, Line_Number, Line
from Qsys2.SysPartitionStat cross join
Lateral(Select Line_Number, Cast(Line as VarChar(256)) Line
from Table(QSYS2.IFS_READ(Path_Name => '/QSYS.Lib/'
concat Trim(System_Table_Schema) concat '.lib/' concat
Trim(System_Table_Name) concat '.file/' concat
Trim(System_Table_Member) concat '.mbr'))) x
Where System_Table_Schema = 'YOURSCHEMA'
and System_Table_Name = 'YOURSRCF'
-- Order By System_Table_Schema, System_Table_Name, System_Table_Member, Line_Number
;
@jwoehr
Copy link

jwoehr commented Jul 4, 2023

Nice! Your mastery of SQL is stunning.
You might consider prepending QSYS2. to SysPartitionStat above

@carlosir
Copy link

I was looking from this.

Thanks Birgitta!!!

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