This file contains 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
-- Run a bash command or script and returns the stdout as a table. | |
-- Each text line will be a row in the result set - the magic is done by the cool "pipe" statement. | |
-- Data is returned in binay (ASCII) so you need the ASC_TOO_EBCDIC to look at at the rows from with in ACS | |
-- So if you just heed to run bash text then use my gist bash_table | |
-- | |
-- It assumes bash is installed by YUM so | |
-- it will be in the default location /QOpenSys/pkgs/bin/bash | |
-- You can use this aproach to other shells like sh, qsh setc. | |
-- You need to have the "ifs_write" procedure found on my gist | |
-- You also need library QSYSINC installed: |
This file contains 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
-- Returns a list numbers: | |
-- from and including FROM value | |
-- until and including TO value | |
-- and optional STEP can be either positive or negative. Default to +1 for step up and -1 for step down | |
-- | |
-- Note: I am using library QUSRSYS. I suggest you put it into your own tool library | |
-- | |
-- Simply paste this gist into ACS SQL and step through the example. | |
-- | |
-- It is a cool example how far you can go with SQL: Have fun 😀 |
This file contains 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
-- Returns a list of all dates in a given year | |
-- | |
-- Note: I am using library QUSRSYS. I suggest you put it into your own tool library | |
-- | |
-- Simply paste this gist into ACS SQL and step through the example. | |
-- | |
-- It is a cool example how far you can go with SQL: Have fun 😀 | |
-- (C) Niels Liisberg 2022 | |
-- | |
-- This gist is distributed on an "as is" basis, without warranties |
This file contains 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
-- List service program procedure exports | |
-- | |
-- Simply paste this gist into ACS SQL and step through the example. | |
-- | |
-- It is a cool example how far you can go with SQL: Have fun 😀 | |
-- (C) Niels Liisberg 2022 | |
-- | |
-- This gist is distributed on an "as is" basis, without warranties | |
-- or conditions of any kind, either expressed or implied. | |
---------------------------------------------------------------------------------------------- |
This file contains 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
-- Log a message to the joblog | |
-- | |
-- This also showcase how to integrate the C code directly into your UDTF/Procedure | |
-- | |
-- Simply paste this gist into ACS SQL and step through the example. | |
-- | |
-- Note: I am using library QUSRSYS. I suggest you put it into your own tool library. | |
-- | |
-- This is a cool example how far you can go with SQL: Have fun 😀 | |
-- (C) Niels Liisberg 2022 |
This file contains 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
-- convert BLOB to a bsae64 CLOB in UTF-8 | |
-- This also showcase how to integrate the C code directly into your UDTF | |
-- | |
-- Simply paste this gist into ACS SQL and step through the example. | |
-- | |
-- It is a cool example how far you can go with SQL: Have fun 😀 | |
-- (C) Niels Liisberg 2022 | |
-- | |
-- This gist is distributed on an "as is" basis, without warranties | |
-- or conditions of any kind, either express or implied. |
This file contains 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
-- This procedure deletes old backup files produced | |
-- when the RSTOBJ command restores file objects. | |
-- | |
-- It uses the regex to filter the names of the files | |
-- the RSTOBJ command gives these file objets in the rename process. | |
-- | |
-- Simply paste this gist into ACS SQL and step through the code. | |
-- | |
-- Note: I am using library QUSRSYS. I suggest you put it into your own tool library | |
-- |
This file contains 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
-- Enable netserver user | |
-- This also showcase how to integrate the C code directly into your UDTF | |
-- | |
-- Simply paste this gist into ACS SQL and step through the example. | |
-- | |
-- It is a cool example how far you can go with SQL: Have fun 😀 | |
-- (C) Niels Liisberg 2022 | |
-- | |
-- This gist is distributed on an "as is" basis, without warranties | |
-- or conditions of any kind, either express or implied. |
This file contains 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
-- Retrieve the system name by call to MI | |
-- This also showcase how to integrate the C code directly into your UDTF | |
-- | |
-- Simply paste this gist into ACS SQL and step through the example. | |
-- | |
-- It is a cool example how far you can go with SQL: Have fun 😀 | |
-- (C) Niels Liisberg 2022 | |
-- | |
-- This gist is distributed on an "as is" basis, without warranties | |
-- or conditions of any kind, either express or implied. |
This file contains 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
-- When indexes are created in one languate - they will not be usable in other languages. | |
-- | |
-- This procedure simply replaces the current *LOCAL | |
-- database name with the name of the system name | |
-- | |
-- Simply paste this gist into ACS SQL and step through the code. | |
-- | |
-- Note: I am using library QUSRSYS. I suggest you put it into your own tool library | |
-- | |
-- It is a cool example how far you can go with SQL: Have fun 😀 |