Skip to content

Instantly share code, notes, and snippets.

View worksofliam's full-sized avatar
🤝
merging PRs

LJ worksofliam

🤝
merging PRs
View GitHub Profile

php2rpg

Guide showing you PHP and RPG differences

  • RPG is strongly typed.
  • RPG indexes start at 1, where PHP starts at 0.
  • Variables in PHP start with a Dollar sign. ($)

Typing

class expRange
{
public int _low;
public int _high;
public expRange(int low, int high)
{
_low = low;
_high = high;
}
ctl-opt dftactgrp(*no);
Dcl-Ds PRODUCTSP EXTNAME('PRODUCTSP');
End-Ds;
dcl-s start timestamp;
dcl-s end timestamp;
dcl-s data varchar(50);
start = %timestamp();
This file has been truncated, but you can view the full file.
--https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/sqlp/rbafyjsonconcepts.htm
drop table barry.docs;
create table barry.docs (
did integer not null GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1),
dcontent blob,
PRIMARY KEY (did)
);
{
"variables": [
{
"type": "subitem",
"name": "GEOTAB_TOKEN",
"keywords": [
"VARCHAR(256)",
"TEMPLATE"
],
"comments": "Used to store the current token from Geotab."
**FREE
//@ Copy selected .csv file to database file SABEL/ARCCPAYMNT.
Dcl-PR CSV_Import EXTPGM ('AR0004CL');
//@ File name of the .csv file.
FileName Char(40);
//@ Output value.
Batch Char(6);
//@ Output value. Not actually used.
Errors Char(1);
<?xml version="1.0" encoding="UTF-8"?>
<QcdCLCmd DTDVersion="1.0">
<Cmd CmdName="RUNSQLSTM" CmdLib="__LIBL" CCSID="37" HlpPnlGrp="QHSQCMDX" HlpPnlGrpLib="__LIBL" HlpID="RUNSQLSTM" MaxPos="4" Prompt="Run SQL Statements" MsgF="QSQLMSG" MsgFLib="__LIBL" ExecBatch="YES" ChgCmdExit="NO" RtvCmdExit="NO">
<Parm Kwd="SRCFILE" PosNbr="1" KeyParm="NO" Type="QUAL" Min="0" Max="1" Prompt="Source file" Rstd="NO" AlwUnprt="YES" AlwVar="YES" Expr="YES" Full="NO" DspInput="YES">
<Qual Type="NAME" Min="0" Max="1" Len="10" Rstd="NO" AlwUnprt="YES" AlwVar="YES" Expr="YES" Full="NO" DspInput="YES" Choice="Name" />
<Qual Type="NAME" Min="0" Max="1" Prompt="Library" Len="10" Rstd="NO" Dft="*LIBL" AlwUnprt="YES" AlwVar="YES" Expr="YES" Full="NO" DspInput="YES" Choice="Name">
<SpcVal>
<Value Val="*LIBL" MapTo="*LIBL" />
<Value Val="*CURLIB" MapTo="*CURLIB" />
</SpcVal>
@worksofliam
worksofliam / vscodeblog1.md
Last active October 14, 2021 17:10
VS Code Extension: Implementing paging in a tree view

NOTE: I am reading and trying to offer information from what I have seen so far. Everyone will have to conduct their own research and make assessments based on findings.

A way to scan the IFS on an IBM i from QSH

This executes a find utility in QSH

NOTE: this should be on many if not all systems – so far I have tested OS 7.1-7.4 with success (UPDATE: I tested this with v5r4 and it worked as well)

  • SBMJOB - Submits the job, JOB(LOG4JSCAN) names the job, and JOBQ(QCTL) submits it to the controlling subsystem (I have been submitting it here to make sure nothing ends it but you could submit it to another JOBQ)
  • find / - we are searching the root path with find
@worksofliam
worksofliam / parser.js
Created December 24, 2021 01:59
/usr/bin/db2 parser
if (output.code == null || output.code === 0) {
let gotHeaders = false;
let figuredLengths = false;
let data = output.stdout.split(`\n`);
/** @type {{name: string, from: number, length: number}[]} */
let headers;
let rows = [];