Skip to content

Instantly share code, notes, and snippets.

View jwoehr's full-sized avatar

Jack J. Woehr jwoehr

View GitHub Profile
@forstie
forstie / Who am i.sql
Last active August 31, 2024 01:45
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;
@BirgittaHauser
BirgittaHauser / ListSrcCode.sql
Last active August 26, 2024 13:54
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