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. ($)
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(); |
--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> |
I found myself needing paging in a TreeView. Here's how I did it.
Video: https://user-images.githubusercontent.com/3708366/137364458-bc9ad98e-b65d-46c9-9b01-7c32e90c44c6.mov
Here's the base for the TreeView class (extending TreeDataProvider
). PAGE_SIZE
is how much to load in each fetch.
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.
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 findif (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 = []; |