This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Subject: Dashboard the storage capacity, including percentage used | |
-- Author: Scott Forstie | |
-- Date : February 11, 2022 | |
-- Features Used : This Gist uses asp_info | |
-- | |
-- | |
-- Capacity numbers are in MB units. | |
-- https://www.ibm.com/docs/en/i/7.4?topic=services-asp-info-view | |
-- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Subject: Using lateral correlation to combine SQL services | |
-- Author: Scott Forstie | |
-- Date : January 9, 2022 | |
-- Features Used : This Gist uses active_job_info, joblog_info, lateral correlation, and the values statement | |
-- | |
-- | |
stop; | |
-- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Subject: Find objects that have the string "log4j" in their name | |
-- Author: Scott Forstie | |
-- Date : December 13, 2021 | |
-- Features Used : This Gist uses ifs_object_statistics, job_info, RUNSQL, and SBMJOB | |
-- | |
-- | |
stop; | |
-- | |
-- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ======================================================================== | |
-- | |
-- Subject: Comparing two spooled files | |
-- Author: Scott Forstie | |
-- Date : December, 2021 | |
-- | |
-- IBM i Services used : OUTPUT_QUEUE_ENTRIES_BASIC, SYSTOOLS.SPOOLED_FILE_DATA | |
-- SQL language features used: CTEs, Exception joins, Union, and row_number() | |
-- ======================================================================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Subject: SQL alternatives to Analyze Default Passwords (ANZDFTPWD) ACTION(*NONE) | |
-- Author: Scott Forstie | |
-- Date : October 26, 2021 | |
-- Features Used : This Gist uses user_info_basic, grouping, and SYSTOOLS.CHANGE_USER_PROFILE | |
-- | |
-- Function - The request was, is there an SQL alternative to the command ANZDFTPWD ACTION(*NONE) ? | |
-- | |
-- | |
stop; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Subject: Establishing a virtual layer in the data model using SQL Views | |
-- Author: Scott Forstie | |
-- Date : Rocktober, 2021 | |
-- Features Used : This Gist uses QSYS2.SYSFILES, QSYS2.SYSCOLUMNS2, dynamic SQL, and SQL PL | |
-- Prereq: IBM i 7.3 or higher, with the Db2 PTF Group level from September 9, 2021 or later | |
-- | |
-- Function - The request was, I don't have a DBE.. I don't have SQL Views... how do I get started with | |
-- shifting users and applications away from directly consuming the physical files? | |
-- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Subject: Extracting the IFS file name from a path, using regular expression built-in functions | |
-- Author: Scott Forstie | |
-- Date : September 27, 2021 | |
-- Features Used : This Gist uses regexp_count, regexp_instr, substr, and SQL PL | |
-- | |
-- Function - The request was, if you have an absolute path, how can SQL extract the filename from the path? | |
-- One approach is found below. | |
-- | |
-- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Subject: IFS stream file transformation | |
-- Author: Scott Forstie (thanks to Sue Romano for helping with this Gist) | |
-- Date : June 28, 2021 | |
-- Features Used : This Gist uses ifs_read, ifs_write, regexp_replace, and the previously unknown fx designation for a unicode literal. | |
-- | |
-- Function - Point is routine at an existing IFS steam file, which contains some character data that you want to globally replace. | |
-- The function extracts (reads) the contents, replaces the search string occurrences with the replacement string, and then | |
-- writes everything to the target IFS stream file. | |
-- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Which CL commands have had their parameter defaults changed? | |
-- (On IBM i 7.3 and higher) | |
-- | |
with libs (lib) as ( | |
select objname | |
from table ( | |
qsys2.OBJECT_STATISTICS('*ALLAVL', '*LIB') | |
) | |
) |