-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from IBM/fix/module_sub_deps
Fixes to multi module program depedencies and makefile
- Loading branch information
Showing
7 changed files
with
423 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,250 @@ | ||
**free | ||
|
||
ctl-opt nomain; | ||
|
||
dcl-s names char(15) dim(78) ctdata; | ||
dcl-s surnames char(15) dim(27) ctdata; | ||
dcl-s streetTypes char(3) dim(9) ctdata; | ||
dcl-s states char(2) dim(50) ctdata; | ||
dcl-s cities char(15) dim(15) ctdata; | ||
|
||
dcl-proc random export; | ||
dcl-pi *n int(10); | ||
low packed(7) const; | ||
high packed(7) const; | ||
end-pi; | ||
|
||
dcl-s result float(8); | ||
dcl-s range packed(7); | ||
dcl-s seed int(10); | ||
|
||
dcl-pr ceeran0 extproc('CEERAN0'); | ||
*n int(10); | ||
*n float(8); | ||
*n char(12) options(*omit); | ||
end-pr; | ||
|
||
range = (high - low) + 1; | ||
ceeran0(seed:result:*omit); | ||
|
||
return %int(result * range); | ||
end-proc; | ||
|
||
dcl-proc getFirst export; | ||
dcl-pi *n char(15); | ||
end-pi; | ||
|
||
return names(random(1:%elem(names))); | ||
end-proc; | ||
|
||
dcl-proc getSurname export; | ||
dcl-pi *n char(15); | ||
end-pi; | ||
|
||
return surnames(random(1:%elem(surnames))); | ||
end-proc; | ||
|
||
dcl-proc getStreetType export; | ||
dcl-pi *n char(3); | ||
end-pi; | ||
|
||
return streetTypes(random(1:%elem(streetTypes))); | ||
end-proc; | ||
|
||
dcl-proc getState export; | ||
dcl-pi *n char(2); | ||
end-pi; | ||
|
||
return states(random(1:%elem(states))); | ||
end-proc; | ||
|
||
dcl-proc getCity export; | ||
dcl-pi *n char(15); | ||
end-pi; | ||
|
||
return cities(random(1:%elem(cities))); | ||
end-proc; | ||
|
||
**CTDATA names | ||
DAVID | ||
JAMES | ||
JOHN | ||
ROBERT | ||
MICHAEL | ||
WILLIAM | ||
MARY | ||
PATRICIA | ||
LINDA | ||
BARBARA | ||
ELIZABETH | ||
JENNIFER | ||
MARIA | ||
SUSAN | ||
MARGARET | ||
DOROTHY | ||
LISA | ||
NANCY | ||
KAREN | ||
BETTY | ||
HELEN | ||
SANDRA | ||
DONNA | ||
CAROL | ||
RUTH | ||
SHARON | ||
MICHELLE | ||
LAURA | ||
SARAH | ||
KIMBERLY | ||
DEBORAH | ||
JESSICA | ||
SHIRLEY | ||
CYNTHIA | ||
ANGELA | ||
MELISSA | ||
BRENDA | ||
AMY | ||
ANNA | ||
REBECCA | ||
VIRGINIA | ||
KATHLEEN | ||
PAMELA | ||
MARTHA | ||
DEBRA | ||
AMANDA | ||
STEPHANIE | ||
CAROLYN | ||
CHRISTINE | ||
MARIE | ||
JANET | ||
CATHERINE | ||
FRANCES | ||
ANN | ||
JOYCE | ||
DIANE | ||
ALICE | ||
JULIE | ||
HEATHER | ||
TERESA | ||
DORIS | ||
GLORIA | ||
EVELYN | ||
JEAN | ||
CHERYL | ||
MILDRED | ||
KATHERINE | ||
JOAN | ||
ASHLEY | ||
JUDITH | ||
ROSE | ||
JANICE | ||
KELLY | ||
NICOLE | ||
JUDY | ||
CHRISTINA | ||
KATHY | ||
THERESA | ||
**CTDATA surnames | ||
SMITH | ||
JOHNSON | ||
WILLIAMS | ||
JONES | ||
BROWN | ||
DAVIS | ||
MILLER | ||
WILSON | ||
MOORE | ||
TAYLOR | ||
ANDERSON | ||
THOMAS | ||
JACKSON | ||
WHITE | ||
HARRIS | ||
MARTIN | ||
THOMPSON | ||
GARCIA | ||
MARTINEZ | ||
ROBINSON | ||
CLARK | ||
RODRIGUEZ | ||
LEWIS | ||
LEE | ||
WALKER | ||
HALL | ||
ALLEN | ||
**CTDATA streetTypes | ||
ST | ||
AVE | ||
RD | ||
DR | ||
CIR | ||
BLVD | ||
WAY | ||
CT | ||
LANE | ||
**CTDATA states | ||
AL | ||
AK | ||
AZ | ||
AR | ||
CA | ||
CO | ||
CT | ||
DE | ||
FL | ||
GA | ||
HI | ||
ID | ||
IL | ||
IN | ||
IA | ||
KS | ||
KY | ||
LA | ||
ME | ||
MD | ||
MA | ||
MI | ||
MN | ||
MS | ||
MO | ||
MT | ||
NE | ||
NV | ||
NH | ||
NJ | ||
NM | ||
NY | ||
NC | ||
ND | ||
OH | ||
OK | ||
OR | ||
PA | ||
RI | ||
SC | ||
SD | ||
TN | ||
TX | ||
UT | ||
VT | ||
VA | ||
WA | ||
WV | ||
WI | ||
WY | ||
**CTDATA cities | ||
SPARTANBURG | ||
GREENVILLE | ||
COLUMBIA | ||
CHARLESTON | ||
MYRTLE BEACH | ||
ROCK HILL | ||
FLORENCE | ||
ASHEVILLE | ||
HENDERSONVILLE | ||
ANDERSON | ||
GREENWOOD | ||
GAFFNEY | ||
EASLEY | ||
GREENWOOD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
**free | ||
|
||
ctl-opt nomain; | ||
|
||
dcl-pr getFirst char(15) extproc('GETFIRST'); | ||
end-pr; | ||
|
||
dcl-pr getSurname char(15) extproc('GETSURNAME'); | ||
end-pr; | ||
|
||
dcl-pr random int(10) extproc('RANDOM'); | ||
low packed(7) const; | ||
high packed(7) const; | ||
end-pr; | ||
|
||
dcl-pr getStreetType char(3) extproc('GETSTREETTYPE'); | ||
end-pr; | ||
|
||
dcl-pr getCity char(15) extproc('GETCITY'); | ||
end-pr; | ||
|
||
dcl-pr getState char(2) extproc('GETSTATE'); | ||
end-pr; | ||
|
||
dcl-proc createCustomer export; | ||
dcl-pi *n int(10); | ||
type char(1) const; | ||
end-pi; | ||
|
||
dcl-f customer qualified keyed usropn usage(*output); | ||
dcl-ds cust likerec(customer.custfmt); | ||
|
||
cust.FIRSTNME = getFirst(); | ||
cust.LASTNAME = getSurname(); | ||
cust.PHONENO = %char(random(1111:9999)); | ||
cust.CREATED = %date; | ||
cust.ADDR1 = %char(random(1:9999)) + ' ' + %trimr(getSurname()) + ' ' + getStreetType(); | ||
cust.CITY = getCity(); | ||
cust.STATE = getState(); | ||
cust.ZIP = %char(random(10000:99999)); | ||
|
||
select; | ||
when (type = '1'); //RLA | ||
OPEN customer; | ||
write customer.CUSTFMT cust; | ||
CLOSE customer; | ||
when (type = '2'); //SQL | ||
EXEC SQL | ||
INSERT INTO CUSTOMER | ||
VALUES(:cust); | ||
|
||
other; | ||
return -1; | ||
endsl; | ||
|
||
end-proc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
**free | ||
|
||
dcl-pr createCustomer int(10) extproc('CREATECUSTOMER'); | ||
type char(1) const; | ||
end-pr; | ||
|
||
ctl-opt dftactgrp(*no); | ||
|
||
createCustomer('1'); | ||
createCustomer('2'); | ||
|
||
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- https://www.ibm.com/docs/en/i/7.3?topic=tables-employee-table-employee | ||
|
||
CREATE OR REPLACE TABLE CUSTOMER | ||
(CUSNO integer not null GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1), | ||
FIRSTNME VARCHAR(12) NOT NULL, | ||
LASTNAME VARCHAR(15) NOT NULL, | ||
PHONENO CHAR(4) NOT NULL, | ||
CREATED DATE NOT NULL DEFAULT CURRENT_DATE, | ||
ADDR1 VARCHAR(30) NOT NULL, | ||
ADDR2 VARCHAR(30) NOT NULL, | ||
CITY VARCHAR(20) NOT NULL, | ||
STATE CHAR(2) NOT NULL, | ||
ZIP CHAR(5) NOT NULL, | ||
PRIMARY KEY (CUSNO) | ||
) RCDFMT CUSTFMT; | ||
|
||
ALTER TABLE CUSTOMER | ||
ADD CONSTRAINT NUMBER | ||
CHECK (PHONENO >= '0000' AND PHONENO <= '9998'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.