Posts

Showing posts from May, 2018

PF2XLS - Python

Image
Convert Physical File / Table to Spreadsheet (Excel) using Python - Xlsxwriter and send the spreadsheet in IFS folder to email address using SNDSMTPEMM. The method is to connvert PF to csv using CPYTOIMPF in IFS then invoke python script to convert it to spreadsheet. The python script can be invoked using shell script. Now all this can be wrapped into CL. Make a custom command - PF2EXCEL. Thanks to Simon Hutchinson (RPGPGM.COM) for teaching me many things on IBM i. I learnt about shell scripting error handling from his blog. Regarding csv to excel, numerous python blog helped to learn and implement it. :-)    ** The python script i enhanced it to bold the header, add borders to columns and also graphs but missed that code during PDP refresh. But just wanted to hihglight the possibilities with python scripting. --------------------------------------------------------------------------------------------- Source code for PF2EXCEL command PF2EXCEL.sh head -1 /...

PROFOUND LOGIC - Web API (Weather App) - Part 3

Image
This blog is about making a web API called to openweathermap.org.  Yes, many have already done this i.e. just from Node.JS console but I wanted to try the same from ProfoundUI screen. I tried many open API's but felt weather app would be a good start. I'm planning to write one with ipconfig.io/json but that's for later.  Create a account with openweather and use the key to access the free current API from program. While Profoundjs has different approach to handle web API but I could not get a grasp of it. I use the traditional Node.JS method to request data . REQUEST module is most popular for making HTTP request. There is HTTP module as well but REQUEST module make it lot easier. The below code submits a HTTP GET request to URL i.e to openweather API and it will return the data i.e. in this can we can opt for HTML or JSON data.  In the below scenario, I have set the JSON:true. The same request can be used for POST, PUT or DELETE. request( URL , function( ...

PROFOUNDly LOGIC on IBM i - Part 2

Image
I started my blog’s to keep a track of things I try on IBM i - REGEXP, Python, Nodes or ProfoundJS.  Btw, I'm totally unfamiliar to JavaScript code but I feel it is good to learn but doing something. I’m learning JavaScript in every little free time I have :-) Now, in this blog its about ProfoundUI with ProfoundJS.  Profoundjs.connector provides connectivity to database i.e  IBM i Db2. Similarly Profound.js has set of API  to run processes. Profound.js has RLA & SQL API’s. I tried CRUD with SQL API. I’m writing lot of SQLRPGLE these days so I prefer it over RLA (Record level Access ). There is couple of videos with Profound TV about SQL access on how to retrieve the data. Below screen is the display file, the usual function keys are CSS buttons - click on it then enter the field name and make it as Boolean indicator, for screen field name  i.e. country code is set with Label  a nd for input field i.e. COUNTRYCD we must chose TextB...

PROFOUNDly LOGIC on IBM i - Part 1

Image
To begin, thanks to IBM i PDP that enables developers and offers no-charge remote access to IBM hardware. Thanks to Profound Logic for providing trail Key and support documentation. I'm using TN5250J.JAR open source java based API to connect to server and have the source in IFS. But i suppose we can use ILEditor for writing JS code (open source).  For general learning, I feel ATOM text editor is best. The post is on my learning and experience of ProfoundUI & ProfoundJS. I have done some very basic stuff and being a beginner   to NodeJS (Javascript) it lotzzz of learning . Profound Logic has videos and online material available for reference. I’m thinking this will be   2 parts -  First, about ProfoundUI along with HANDLER keyword on RPGLE and second use the same ProfoundUI on ProfoundJS (Javascript). ProfoundUI & ProfoundJS is open source which can be installed with npm (node package manager) but profound connector is commercial ad...