|
I couldn't find anything on the web like this, so I wrote my own.
Enjoy, Gavin
==============================
Destination Table
==============================
CREATE TABLE QTEMP.PTFIN (
RELEASE CHAR(4) NOT NULL,
NUMBER CHAR(7) NOT NULL,
TITLE CHAR(50) NOT NULL,
LEVEL CHAR(5) NOT NULL,
DATE CHAR(10) NOT NULL
)
RCDFMT R@PTFINFO;
LABEL ON TABLE QTEMP.PTFIN IS 'PTF Information from IBM Website';
============================
SQLRPGLE Program
============================
**Free
Ctl-Opt Debug Option(*SrcStmt:*NoDebugIO);
Ctl-Opt ActGrp(*Caller);
DCL-DS psp dim(500) qualified ;
release char(4) ;
number char(7) ;
title char(50) ;
level char(5) ;
date char(10) ;
END-DS;
DCL-DS psp1 ;
release char(4) ;
number char(7) ;
title char(50) ;
level char(5) ;
date char(10) ;
END-DS;
Dcl-s PTFINFO VarChar(32000);
dcl-s i int(5) ;
Dcl-s Web varchar(256)
inz('https://public.dhe.ibm.com/services/us/igsc/PSP/xmldoc.xml');
EXEC SQL
TRUNCATE PTFIN ;
Exec SQL
SELECT RESPONSE_MESSAGE
into :PTFINFO
FROM TABLE(QSYS2.HTTP_GET_VERBOSE(
(:web),
'{"sslTolerate":"true","header": "Accept,application/json"}')) ;
XML-INTO psp %XML(ptfinfo:'case=any') ;
for i = 1 to 500 ;
if psp(i).release <> *blanks ;
eval psp1=psp(i) ;
Exec SQL
INSERT into PTFIN (release, number, title, level, date)
values(:release, :number, :title, :level, :date) ;
ENDIF;
ENDFOR;
*INLR=*ON ;
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.