Skip to content

Instantly share code, notes, and snippets.

View RainerRoss's full-sized avatar
🏠
Working from home

Rainer Ross RainerRoss

🏠
Working from home
  • Rainer Ross IT-Consulting
  • Munich, Germany
View GitHub Profile
ctl-opt dftactgrp(*no) alloc(*teraspace) option(*nodebugio:*nounref)
main(main) actgrp('MACHINE') bnddir('WEBSRVUTL');
//------------------------------------------------------------------//
// //
// Webservice Maschinen JSON-Format with JSON_ARRAYAGG //
// //
//----------------- //
// R.Ross 03.2019 * //
//------------------------------------------------------------------//
// Prototypes //
@RainerRoss
RainerRoss / PTRARRAY.RPGLE
Created July 19, 2020 10:08
Code for the Array based on pointers in RPG AS400 powered by Sam John
ctl-opt dftactgrp(*no) main(main);
//------------------------------------------------------------------//
// Code for the Array based on pointers in RPG AS400 from Sam John //
// https://www.myeasyclasses.com/2020/07/ //
// code-for-array-based-on-pointers-in-rpg.html //
//------------------------------------------------------------------//
dcl-proc main;
dcl-s ArrayData char(10) dim(10) based(ptr1);
dcl-s ptr1 pointer;
@RainerRoss
RainerRoss / PRFHDL.RPGLE
Last active March 20, 2022 17:55
ProfileHandle
//------------------------------------------------------------------//
// QSYGETPH - Get Profile Handle //
//------------------------------------------------------------------//
dcl-pr getPrfHdl extpgm('QSYGETPH');
User like(GblUser) const; // User
Password like(GblPassword) const; // Password
Handle like(GblHandle); // Profilehandle
Apierr like(DsApierr) const; // API-Error
Pwdlen like(GblPwdlen) const; // Password-Length
@RainerRoss
RainerRoss / chatserver.js
Last active March 20, 2022 17:56
chat server
var express = require('/QOpenSys/QIBM/ProdData/Node/bin/node_modules/express');
var app = express();
var server = require('http').createServer(app);
var io = require('/QOpenSys/QIBM/ProdData/Node/bin/node_modules/socket.io').listen(server);
var conf = {"port": 8020};
app.use("/css", express.static(__dirname + '/css'));
app.get('/', function(request, response) {
response.sendfile(__dirname + '/html/index_chat.htm');
@RainerRoss
RainerRoss / writedata.js
Last active March 20, 2022 17:56
write data to DB/2
var db = require('/QOpenSys/QIBM/ProdData/Node/os400/db2i/lib/db2');
var chatdata = {
date : "2015-01-04",
time : "10:45:05",
user : "Rainer",
text : "this is a wonderful text"
};
function createString(data) {
ctl-opt main(main) dftactgrp(*no) option(*nounref);
//------------------------------------------------------------------//
// //
// Get Copper-Prices with HTTPGETCLOB //
// //
//----------------- //
// R.Ross 08.2018 * //
//------------------------------------------------------------------//
// Array XML-File - Das Rootelement quandl-response wird mit //
// Rsp (Response) abgekürzt: path=quandl-response //
//------------------------------------------------------------------//
// Create JSON-Status //
//------------------------------------------------------------------//
dcl-pr crtJSONStatus char(270) ccsid(*utf8) rtnparm;
PiSuccess varchar(05) const;
PiErrmsg char(256) const;
end-pr;
ctl-opt dftactgrp(*no) alloc(*teraspace) option(*nodebugio)
main(main) actgrp('UPLOAD') bnddir('WEBSRVUTL':'YAJL');
//------------------------------------------------------------------//
// //
// File Upload with Webix //
// //
//----------------- //
// R.Ross 09.2018 * //
//------------------------------------------------
ctl-opt dftactgrp(*no) actgrp('ADDME') pgminfo(*pcml:*module);
//------------------------------------------------------------------//
// SOAP-Webservice //
//------------------------------------------------------------------//
//------------------------------------------------------------------//
// Parameter //
//------------------------------------------------------------------//
dcl-pr addme;
ctl-opt dftactgrp(*no) alloc(*teraspace) option(*nodebugio:*nounref)
main(main) actgrp('GETXML') bnddir('WEBSRVUTL');
//------------------------------------------------------------------//
// //
// Get XMLInput from HTTP-Server and send XMLOutput to HTTP-Server //
// //
//----------------- //
// R.Ross 09.2018 * //
//------------------------------------------------