From 0279066993041912e4d19d389c1416a4eb5a9eaa Mon Sep 17 00:00:00 2001 From: SJLennon <67484051+SJLennon@users.noreply.github.com> Date: Thu, 9 May 2024 11:46:31 -0400 Subject: [PATCH] DATEADJ to ReadMe & Misc --- .vscode/actions.json | 74 ++++++++++++++++++++++++++++++++++ README.md | 4 ++ USPS_Address/USADRVAL.SQLRPGLE | 23 ++++++++--- USPS_Address/USADRVAL_T.RPGLE | 4 +- 4 files changed, 97 insertions(+), 8 deletions(-) create mode 100644 .vscode/actions.json diff --git a/.vscode/actions.json b/.vscode/actions.json new file mode 100644 index 0000000..749b3fe --- /dev/null +++ b/.vscode/actions.json @@ -0,0 +1,74 @@ +[ + { + "name": "Create RPGLE Program", + "command": "CRTBNDRPG PGM(&CURLIB/&NAME) SRCSTMF('&RELATIVEPATH') OPTION(*EVENTF) DBGVIEW(*SOURCE) TGTCCSID(*JOB)", + "deployFirst": true, + "environment": "ile", + "extensions": [ + "RPGLE" + ] + }, + { + "name": "Create RPGLE Module", + "command": "CRTRPGMOD MODULE(&CURLIB/&NAME) SRCSTMF('&RELATIVEPATH') OPTION(*EVENTF) DBGVIEW(*SOURCE) TGTCCSID(*JOB)", + "deployFirst": true, + "environment": "ile", + "extensions": [ + "RPGLE" + ] + }, + { + "name": "Create SQLRPGLE Program", + "command": "CRTSQLRPGI OBJ(&CURLIB/&NAME) SRCSTMF('&RELATIVEPATH') OPTION(*EVENTF) DBGVIEW(*SOURCE) CLOSQLCSR(*ENDMOD) CVTCCSID(*JOB) COMPILEOPT('TGTCCSID(*JOB)') RPGPPOPT(*LVL2)", + "deployFirst": true, + "environment": "ile", + "extensions": [ + "SQLRPGLE" + ] + }, + { + "name": "Create SQLRPGLE Module", + "command": "CRTSQLRPGI OBJ(&CURLIB/&NAME) SRCSTMF('&RELATIVEPATH') OBJTYPE(*MODULE) OPTION(*EVENTF) DBGVIEW(*SOURCE) CLOSQLCSR(*ENDMOD) CVTCCSID(*JOB) COMPILEOPT('TGTCCSID(*JOB)') RPGPPOPT(*LVL2)", + "deployFirst": true, + "environment": "ile", + "extensions": [ + "SQLRPGLE" + ] + }, + { + "extensions": [ + "CLP", + "CLLE" + ], + "name": "Create Bound CL Program", + "command": "CRTBNDCL PGM(&CURLIB/&NAME) SRCSTMF('&RELATIVEPATH') OPTION(*EVENTF) DBGVIEW(*SOURCE)", + "deployFirst": true, + "environment": "ile" + }, + { + "extensions": [ + "cmd" + ], + "name": "Create Command", + "command": "CRTCMD CMD(&CURLIB/&NAME) PGM(&CURLIB/&NAME) SRCSTMF('&RELATIVEPATH') OPTION(*EVENTF)", + "deployFirst": true, + "environment": "ile" + }, + { + "extensions": [ + "SQL", + "TABLE", + "VIEW", + "SQLPRC", + "SQLUDF", + "SQLUDT", + "SQLTRG", + "SQLALIAS", + "SQLSEQ" + ], + "name": "Run SQL Statements (RUNSQLSTM)", + "command": "RUNSQLSTM SRCSTMF('&FULLPATH') COMMIT(*NONE) NAMING(*SQL)", + "deployFirst": true, + "environment": "ile" + } +] \ No newline at end of file diff --git a/README.md b/README.md index 21365f6..402b928 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,10 @@ Many shops are still using 5250 "green screen" applications and these need to be A service program to add 1 to an alpha-numeric string of any length. +## DATEADJ + +A command to add or subtract from a date in a CL program + ## DATE_UDF SQL User Defined Functions to convert legacy dates to true dates. Written in RPG. diff --git a/USPS_Address/USADRVAL.SQLRPGLE b/USPS_Address/USADRVAL.SQLRPGLE index d38950c..c46e3b4 100644 --- a/USPS_Address/USADRVAL.SQLRPGLE +++ b/USPS_Address/USADRVAL.SQLRPGLE @@ -20,6 +20,10 @@ // input and output, but it doesn't have to be the same memory // in the caller. Use copy member USAdrValDS. //==================================================================== +// 04/2024 LENNON +// Change to HTTPS +// Provide password, even though it currently seems to be ignored. +//==================================================================== ctl-opt nomain @@ -35,7 +39,10 @@ ctl-opt // === Data area containing your USPS supplied User id. ============== // (The USPS supplied USER ID length is not clear, so I made it // longer than the 12-char one supplied to me..) -dcl-ds USPS_ID dtaara len(20) qualified; +// Ditto for password, though password seems to be ignored. +dcl-ds USPS_ID dtaara len(20) qualified; +end-ds; +dcl-ds USPS_PWD dtaara len(20) qualified; end-ds; //=== USAdrVal ======================================================= @@ -54,20 +61,24 @@ dcl-proc USAdrVal export; dcl-ds po likeds(USAdrValDS); dcl-s ID varchar(20); - // Get USPS UserID. + dcl-s PWD varchar(20); + // Get USPS UserID & Password in USPS_ID; ID = %trim(USPS_ID); + in USPS_PWD; + PWD = %trim(USPS_PWD); clear po; // Call USPS Address Validate API. It returns an XML document. exec sql values QSYS2.HTTP_GET( - 'http://production.shippingapis.com/ShippingAPI.dll' + 'https://secure.shippingapis.com/ShippingAPI.dll' concat '?API=Verify&XML=' concat url_encode( - '' concat + '' concat '1' concat '
' concat '' concat :pi.Address1 concat '' concat @@ -77,7 +88,7 @@ dcl-proc USAdrVal export; '' concat :pi.Zip5 concat '' concat '' concat :pi.Zip4 concat '' concat '
' concat - '
' + '
' ) ) into :retXML; if (SQLSTATE <> SQLSUCCESS); diff --git a/USPS_Address/USADRVAL_T.RPGLE b/USPS_Address/USADRVAL_T.RPGLE index dccd7b6..bcdc7d1 100644 --- a/USPS_Address/USADRVAL_T.RPGLE +++ b/USPS_Address/USADRVAL_T.RPGLE @@ -1,6 +1,6 @@ **free ctl-opt debug option(*nodebugio: *srcstmt) - dftactgrp(*no) actgrp(*caller) + dftactgrp(*no) actgrp('USPS') bnddir('UTIL_BND':'SQL_BND':'ADRVAL_BND') main(Main); //==================================================================== @@ -83,7 +83,7 @@ dcl-proc Main; return; end-proc Main; -//=== Routine to print input and outpur side by side ================= +//=== Routine to print input and output side by side ================= dcl-proc DspAdr; dcl-pi DspAdr; pi likeds(USAdrValDS);