Skip to content

Commit 0279066

Browse files
committed
DATEADJ to ReadMe & Misc
1 parent 21917dd commit 0279066

File tree

4 files changed

+97
-8
lines changed

4 files changed

+97
-8
lines changed

.vscode/actions.json

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
[
2+
{
3+
"name": "Create RPGLE Program",
4+
"command": "CRTBNDRPG PGM(&CURLIB/&NAME) SRCSTMF('&RELATIVEPATH') OPTION(*EVENTF) DBGVIEW(*SOURCE) TGTCCSID(*JOB)",
5+
"deployFirst": true,
6+
"environment": "ile",
7+
"extensions": [
8+
"RPGLE"
9+
]
10+
},
11+
{
12+
"name": "Create RPGLE Module",
13+
"command": "CRTRPGMOD MODULE(&CURLIB/&NAME) SRCSTMF('&RELATIVEPATH') OPTION(*EVENTF) DBGVIEW(*SOURCE) TGTCCSID(*JOB)",
14+
"deployFirst": true,
15+
"environment": "ile",
16+
"extensions": [
17+
"RPGLE"
18+
]
19+
},
20+
{
21+
"name": "Create SQLRPGLE Program",
22+
"command": "CRTSQLRPGI OBJ(&CURLIB/&NAME) SRCSTMF('&RELATIVEPATH') OPTION(*EVENTF) DBGVIEW(*SOURCE) CLOSQLCSR(*ENDMOD) CVTCCSID(*JOB) COMPILEOPT('TGTCCSID(*JOB)') RPGPPOPT(*LVL2)",
23+
"deployFirst": true,
24+
"environment": "ile",
25+
"extensions": [
26+
"SQLRPGLE"
27+
]
28+
},
29+
{
30+
"name": "Create SQLRPGLE Module",
31+
"command": "CRTSQLRPGI OBJ(&CURLIB/&NAME) SRCSTMF('&RELATIVEPATH') OBJTYPE(*MODULE) OPTION(*EVENTF) DBGVIEW(*SOURCE) CLOSQLCSR(*ENDMOD) CVTCCSID(*JOB) COMPILEOPT('TGTCCSID(*JOB)') RPGPPOPT(*LVL2)",
32+
"deployFirst": true,
33+
"environment": "ile",
34+
"extensions": [
35+
"SQLRPGLE"
36+
]
37+
},
38+
{
39+
"extensions": [
40+
"CLP",
41+
"CLLE"
42+
],
43+
"name": "Create Bound CL Program",
44+
"command": "CRTBNDCL PGM(&CURLIB/&NAME) SRCSTMF('&RELATIVEPATH') OPTION(*EVENTF) DBGVIEW(*SOURCE)",
45+
"deployFirst": true,
46+
"environment": "ile"
47+
},
48+
{
49+
"extensions": [
50+
"cmd"
51+
],
52+
"name": "Create Command",
53+
"command": "CRTCMD CMD(&CURLIB/&NAME) PGM(&CURLIB/&NAME) SRCSTMF('&RELATIVEPATH') OPTION(*EVENTF)",
54+
"deployFirst": true,
55+
"environment": "ile"
56+
},
57+
{
58+
"extensions": [
59+
"SQL",
60+
"TABLE",
61+
"VIEW",
62+
"SQLPRC",
63+
"SQLUDF",
64+
"SQLUDT",
65+
"SQLTRG",
66+
"SQLALIAS",
67+
"SQLSEQ"
68+
],
69+
"name": "Run SQL Statements (RUNSQLSTM)",
70+
"command": "RUNSQLSTM SRCSTMF('&FULLPATH') COMMIT(*NONE) NAMING(*SQL)",
71+
"deployFirst": true,
72+
"environment": "ile"
73+
}
74+
]

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ Many shops are still using 5250 "green screen" applications and these need to be
6060

6161
A service program to add 1 to an alpha-numeric string of any length.
6262

63+
## DATEADJ
64+
65+
A command to add or subtract from a date in a CL program
66+
6367
## DATE_UDF
6468

6569
SQL User Defined Functions to convert legacy dates to true dates. Written in RPG.

USPS_Address/USADRVAL.SQLRPGLE

+17-6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
// input and output, but it doesn't have to be the same memory
2121
// in the caller. Use copy member USAdrValDS.
2222
//====================================================================
23+
// 04/2024 LENNON
24+
// Change to HTTPS
25+
// Provide password, even though it currently seems to be ignored.
26+
//====================================================================
2327

2428
ctl-opt
2529
nomain
@@ -35,7 +39,10 @@ ctl-opt
3539
// === Data area containing your USPS supplied User id. ==============
3640
// (The USPS supplied USER ID length is not clear, so I made it
3741
// longer than the 12-char one supplied to me..)
38-
dcl-ds USPS_ID dtaara len(20) qualified;
42+
// Ditto for password, though password seems to be ignored.
43+
dcl-ds USPS_ID dtaara len(20) qualified;
44+
end-ds;
45+
dcl-ds USPS_PWD dtaara len(20) qualified;
3946
end-ds;
4047

4148
//=== USAdrVal =======================================================
@@ -54,20 +61,24 @@ dcl-proc USAdrVal export;
5461
dcl-ds po likeds(USAdrValDS);
5562

5663
dcl-s ID varchar(20);
57-
// Get USPS UserID.
64+
dcl-s PWD varchar(20);
65+
// Get USPS UserID & Password
5866
in USPS_ID;
5967
ID = %trim(USPS_ID);
68+
in USPS_PWD;
69+
PWD = %trim(USPS_PWD);
6070

6171
clear po;
6272

6373
// Call USPS Address Validate API. It returns an XML document.
6474
exec sql
6575
values QSYS2.HTTP_GET(
66-
'http://production.shippingapis.com/ShippingAPI.dll'
76+
'https://secure.shippingapis.com/ShippingAPI.dll'
6777
concat '?API=Verify&XML=' concat
6878
url_encode(
69-
'<AddressValidateRequest ' concat
70-
'USERID="' concat :ID concat '">' concat
79+
'<AddressValidateRequest ' concat
80+
'USERID="' concat :ID concat '"'
81+
concat ' PASSWORD="' concat :PWD concat '">' concat
7182
'<Revision>1</Revision>' concat
7283
'<Address ID="0">' concat
7384
'<Address1>' concat :pi.Address1 concat '</Address1>' concat
@@ -77,7 +88,7 @@ dcl-proc USAdrVal export;
7788
'<Zip5>' concat :pi.Zip5 concat '</Zip5>' concat
7889
'<Zip4>' concat :pi.Zip4 concat '</Zip4>' concat
7990
'</Address>' concat
80-
'</AddressValidateRequest>'
91+
'</AddressValidateRequest>'
8192
)
8293
) into :retXML;
8394
if (SQLSTATE <> SQLSUCCESS);

USPS_Address/USADRVAL_T.RPGLE

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
**free
22
ctl-opt debug option(*nodebugio: *srcstmt)
3-
dftactgrp(*no) actgrp(*caller)
3+
dftactgrp(*no) actgrp('USPS')
44
bnddir('UTIL_BND':'SQL_BND':'ADRVAL_BND')
55
main(Main);
66
//====================================================================
@@ -83,7 +83,7 @@ dcl-proc Main;
8383
return;
8484
end-proc Main;
8585

86-
//=== Routine to print input and outpur side by side =================
86+
//=== Routine to print input and output side by side =================
8787
dcl-proc DspAdr;
8888
dcl-pi DspAdr;
8989
pi likeds(USAdrValDS);

0 commit comments

Comments
 (0)