Skip to content

Instantly share code, notes, and snippets.

View jwoehr's full-sized avatar

Jack J. Woehr jwoehr

View GitHub Profile
@BirgittaHauser
BirgittaHauser / ListSrcCode.sql
Last active March 26, 2024 01:00
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
@forstie
forstie / Who am i.sql
Last active January 25, 2024 22:17
I was asked to provide a query that pulls together some of the basic identity detail for the IBM i you're connect to... which got me to this....
--
-- Who am i?
--
select s.host_name, e.host_name, 'IBM i ' concat os_version concat '.' concat os_release as ibmi_level,
serial_number, machine_type, machine_model,
ipl_mode, ipl_type, attention_light,
total_cpus, e.configured_cpus,
configured_memory, total_memory,
s.*
from sysibmadm.env_sys_info e, qsys2.system_status_info s;