Merge pull request 'Reload startupservice after user approves the MPE_TABLES changes' (#170) from issue157 into main
All checks were successful
Release / Build-production-and-ng-test (push) Successful in 4m8s
Release / Build-and-test-development (push) Successful in 8m47s
Release / release (push) Successful in 8m50s

Reviewed-on: #170
This commit was merged in pull request #170.
This commit is contained in:
2025-06-11 13:16:22 +00:00
42 changed files with 820 additions and 236 deletions

View File

@@ -1,11 +1,12 @@
#!/bin/sh
# Avoid commits to the master branch
BRANCH=`git rev-parse --abbrev-ref HEAD`
REGEX="^(master|development)$"
# Using `--silent` helps for showing any errs in the first line of the response
# The first line is picked up by the VS Code GIT UI popup when rc is not 0
if [[ "$BRANCH" =~ $REGEX ]]; then
echo "You are on branch $BRANCH. Are you sure you want to commit to this branch?"
echo "If so, commit with -n to bypass the pre-commit hook."
exit 1
if npm run --silent lint:silent ; then
exit 0
else
npm run --silent lint:fix
echo "❌ Prettier check failed! We ran lint:fix for you. Please add & commit again."
exit 1
fi

View File

@@ -23,7 +23,16 @@ _Problems with the above include:_
Data Controller for SAS® solves all these issues in a simple-to-install, user-friendly, secure, documented, battle-tested web application. Available on Viya, SAS 9 EBI, and [SASjs Server](https://server.sasjs.io).
For more information:
An individual Viya deploy can be done in just 2 lines of #SAS code!
```sas
filename dc url "https://git.datacontroller.io/dc/dc/releases/download/latest/viya.sas";
%inc dc;
```
For a multi-user deploy, using a shared system account, please see [deploy docs](https://docs.datacontroller.io/deploy-viya/).
For further information:
* Main site: https://datacontroller.io
* Docs: https://docs.datacontroller.io

View File

@@ -21,7 +21,7 @@
"@clr/icons": "^13.0.2",
"@clr/ui": "file:libraries/clr-ui-17.9.0.tgz",
"@handsontable/angular": "^15.3.0",
"@sasjs/adapter": "^4.12.0",
"@sasjs/adapter": "^4.12.1",
"@sasjs/utils": "^3.4.0",
"@sheet/crypto": "file:libraries/sheet-crypto.tgz",
"@types/d3-graphviz": "^2.6.7",
@@ -5912,9 +5912,9 @@
]
},
"node_modules/@sasjs/adapter": {
"version": "4.12.0",
"resolved": "https://registry.npmjs.org/@sasjs/adapter/-/adapter-4.12.0.tgz",
"integrity": "sha512-1W78CzWyovSNSgjJ36fyckAGrzYqaRyDpjyO+sTchv3JjY0G7ZKw2gaX+NVASDGhKvt4L9PEkJ/Gk7ZG2BSkJA==",
"version": "4.12.1",
"resolved": "https://registry.npmjs.org/@sasjs/adapter/-/adapter-4.12.1.tgz",
"integrity": "sha512-0217oZIkrecOyQygRe6Azgc1C4TIcjB5noi15fU4Rd5GsfDpleKVfQQdzYZ7im/vesWlLIVl/yUT67MMaQe0ew==",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {

View File

@@ -49,7 +49,7 @@
"@clr/icons": "^13.0.2",
"@clr/ui": "file:libraries/clr-ui-17.9.0.tgz",
"@handsontable/angular": "^15.3.0",
"@sasjs/adapter": "^4.12.0",
"@sasjs/adapter": "^4.12.1",
"@sasjs/utils": "^3.4.0",
"@sheet/crypto": "file:libraries/sheet-crypto.tgz",
"@types/d3-graphviz": "^2.6.7",

View File

@@ -8,4 +8,5 @@ export interface Libinfo {
LIBID: string
LIBSIZE: number
TABLE_CNT: number
CATALOG_CNT: number
}

View File

@@ -1,30 +1,14 @@
import { BaseSASResponse } from './common/BaseSASResponse'
export interface EditorsStageDataSASResponse extends BaseSASResponse {
SYSDATE: string
SYSTIME: string
sasparams: Sasparam[]
_DEBUG: string
_PROGRAM: string
AUTOEXEC: string
MF_GETUSER: string
SYSCC: string
SYSENCODING: string
SYSERRORTEXT: string
SYSHOSTINFOLONG: string
SYSHOSTNAME: string
SYSPROCESSID: string
SYSPROCESSMODE: string
SYSPROCESSNAME: string
SYSJOBID: string
SYSSCPL: string
SYSSITE: string
SYSTCPIPHOSTNAME: string
SYSUSERID: string
SYSVLONG: string
SYSWARNINGTEXT: string
END_DTTM: string
MEMSIZE: string
}
export interface Sasparam {

View File

@@ -0,0 +1,28 @@
import { BaseSASResponse } from './common/BaseSASResponse'
export interface PublicGetChangeinfo extends BaseSASResponse {
jsparams: Jsparam[]
}
export interface Jsparam {
TABLE_ID: string
SUBMIT_STATUS_CD: string
BASE_LIB: string
BASE_DS: string
SUBMITTED_BY_NM: string
SUBMITTED_ON: number
SUBMITTED_REASON_TXT: string
INPUT_OBS: number
INPUT_VARS: number
NUM_OF_APPROVALS_REQUIRED: number
NUM_OF_APPROVALS_REMAINING: number
REVIEWED_BY_NM: string
REVIEWED_ON?: any
TABLE_NM: string
BASE_TABLE: string
REVIEWED_ON_DTTM: string
SUBMITTED_ON_DTTM: string
LIB_ENGINE: string
ALLOW_RESTORE: string
REASON: string
}

View File

@@ -13,6 +13,8 @@ import {
AuditorsPostdataSASResponse,
Param
} from '../../models/sas/auditors-postdata.model'
import { PublicGetChangeinfo } from 'src/app/models/sas/public-getchangeinfo.model'
import { SasService } from 'src/app/services'
interface ChangesObj {
ind: any
@@ -76,9 +78,11 @@ export class ApproveDetailsComponent implements AfterViewInit, OnDestroy {
public diffsLimit: boolean = false
public recordsLimit: number = 100
public refreshStartupserviceAfterApprove: boolean = false
constructor(
private sasStoreService: SasStoreService,
private sasService: SasService,
private eventService: EventService,
private router: ActivatedRoute,
private route: Router
@@ -162,6 +166,9 @@ export class ApproveDetailsComponent implements AfterViewInit, OnDestroy {
await this.sasStoreService
.approveTable(approveParams, 'SASControlTable', 'auditors/postdata')
.then((res: any) => {
// If we are approving MPE_TABLES we will arm the trigger for the reload of startup data to se the updated tables
if (this.refreshStartupserviceAfterApprove)
this.sasService.reloadStartupData()
this.route.navigateByUrl('/review/history')
})
.catch((err: any) => {
@@ -176,7 +183,7 @@ export class ApproveDetailsComponent implements AfterViewInit, OnDestroy {
public async callChangesInfo(tableId: any) {
await this.sasStoreService
.getChangeInfo(tableId)
.then((res: any) => {
.then((res: PublicGetChangeinfo) => {
this.tableDetails = res.jsparams[0]
this.jsParams = res.jsparams[0]
@@ -189,6 +196,11 @@ export class ApproveDetailsComponent implements AfterViewInit, OnDestroy {
}
this.keysArray = keysArray
// If we are approving MPE_TABLES we will arm the trigger for the reload of startup data to se the updated tables
// After user approved if armed, reload will be triggered
if (res.jsparams[0].BASE_DS === 'MPE_TABLES')
this.refreshStartupserviceAfterApprove = true
})
.catch((err: any) => {
this.acceptLoading = false

View File

@@ -333,6 +333,10 @@ export class SasService {
})
}
public reloadStartupData() {
this.loadStartupServiceEmitter.emit()
}
public getLicenseSiteId(): string[] {
return this.license_site_id.value || []
}

View File

@@ -598,6 +598,12 @@
{{ libinfo[0] ? libinfo[0].TABLE_CNT : '' }}
</td>
</tr>
<tr *ngIf="libinfo[0].CATALOG_CNT !== null">
<td class="m-0">CATALOG_CNT:</td>
<td class="m-0 font-bold">
{{ libinfo[0] ? libinfo[0].CATALOG_CNT : '' }}
</td>
</tr>
</table>
</ng-container>
</div>

View File

@@ -19,7 +19,9 @@
"lint": "npm run lint:fix",
"lint:fix": "npx prettier --write \"client/{src,test}/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\" \"client/cypress/integration/*.tests.ts\"",
"lint:check": "npx prettier --check \"client/{src,test}/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\" \"client/cypress/integration/*.tests.ts\"",
"jo": "echo"
"lint:silent": "npx prettier --loglevel silent --check \"client/{src,test}/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\" \"client/cypress/integration/*.tests.ts\"",
"jo": "echo",
"prepare": "git rev-parse --git-dir && git config core.hooksPath ./.git-hooks && git config core.autocrlf false || true"
},
"repository": {
"type": "git",

32
sas/package-lock.json generated
View File

@@ -6,8 +6,8 @@
"": {
"name": "dc-sas",
"dependencies": {
"@sasjs/cli": "^4.12.7",
"@sasjs/core": "^4.58.2"
"@sasjs/cli": "^4.12.8",
"@sasjs/core": "^4.59.1"
}
},
"node_modules/@coolaj86/urequest": {
@@ -30,9 +30,9 @@
}
},
"node_modules/@sasjs/adapter": {
"version": "4.11.3",
"resolved": "https://registry.npmjs.org/@sasjs/adapter/-/adapter-4.11.3.tgz",
"integrity": "sha512-KF6G4vzs4l4efjpCD02og3kB44uFfJ1u2UWu749VdHtLKNN9l+PO26/moR+YAmRmmz2I9sC3X09fZE1nlN6zgw==",
"version": "4.12.1",
"resolved": "https://registry.npmjs.org/@sasjs/adapter/-/adapter-4.12.1.tgz",
"integrity": "sha512-0217oZIkrecOyQygRe6Azgc1C4TIcjB5noi15fU4Rd5GsfDpleKVfQQdzYZ7im/vesWlLIVl/yUT67MMaQe0ew==",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {
@@ -45,14 +45,14 @@
}
},
"node_modules/@sasjs/cli": {
"version": "4.12.7",
"resolved": "https://registry.npmjs.org/@sasjs/cli/-/cli-4.12.7.tgz",
"integrity": "sha512-KcXSR+3dRgINOLiN+7oJbzWsNQu7qm1YQ7eaVqiHTZI429BSgZez9+7p1bq09R4otHN8IzMAgLP9se/r9p9yJA==",
"version": "4.12.8",
"resolved": "https://registry.npmjs.org/@sasjs/cli/-/cli-4.12.8.tgz",
"integrity": "sha512-20WiywlcLV22T1XfkAumV66mM3PfQ1N9ihJfpxoOVCFs2wF/ZertqnP4BZ5CE1dc30M1C2oDOzzSSVZqePPQnw==",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {
"@sasjs/adapter": "4.11.3",
"@sasjs/core": "4.58.1",
"@sasjs/adapter": "4.12.1",
"@sasjs/core": "4.59.1",
"@sasjs/lint": "2.4.3",
"@sasjs/utils": "3.5.2",
"adm-zip": "0.5.10",
@@ -76,16 +76,10 @@
"sasjs": "build/index.js"
}
},
"node_modules/@sasjs/cli/node_modules/@sasjs/core": {
"version": "4.58.1",
"resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.58.1.tgz",
"integrity": "sha512-Qp6KAtp1VZcmN5HLGSIUE9H41qpFuihWLbjNygOYp+NRs/Y8VagpHrYeyIQbh3cSgchiJEMXudLql8hoU06wpg==",
"license": "MIT"
},
"node_modules/@sasjs/core": {
"version": "4.58.2",
"resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.58.2.tgz",
"integrity": "sha512-P/DMCHfFrZT+50DIT7CiYBSjxOo5m0AHBLNKHGFOMfQnEymOKekQPk2Xzw5wkQyg8gjp2yBKhRwhpni5rvJFgQ==",
"version": "4.59.1",
"resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.59.1.tgz",
"integrity": "sha512-52GNI4nIll5YivI8uobWrucE6TkHcTjcbKTr/YPC9eTauC4sh0V0MptebfAJ5E6vE5P2WevNZGr42KdDpckLpg==",
"license": "MIT"
},
"node_modules/@sasjs/lint": {

View File

@@ -22,13 +22,13 @@
"serverdata": "sasjs request services/admin/makedata -d deploy/makeDataServer.json -l sasjsresults/makedata_server.log -o sasjsresults/makedata_server.json -t server",
"viya": "npm run viyacbd && sasjs test",
"viyacbd": "sasjs folder delete /Public/app/viya && sasjs cbd -t viya && npm run viyadata",
"viyadata": "sasjs request services/admin/makedata -d deploy/makeDataViya.json -l sasjsresults/makedata.log -o sasjsresults/output.json",
"viyadata": "sasjs request services/admin/makedata -d deploy/makeDataViya.json -l sasjsresults/makedata.log -o sasjsresults/output.json -t viya",
"v4data": "sasjs request services/admin/makedata -d deploy/makeDataV4.json -l sasjsresults/makedatav4.log -o sasjsresults/outputv4.json -t v4",
"sasdocs": "sasjs doc && ./sasjs/utils/deploydocs.sh"
},
"private": true,
"dependencies": {
"@sasjs/cli": "^4.12.7",
"@sasjs/core": "^4.58.2"
"@sasjs/cli": "^4.12.8",
"@sasjs/core": "^4.59.1"
}
}
}

View File

@@ -0,0 +1,17 @@
/**
@file mpe_datacatalog_CATS.ddl
@brief ddl file
@details
@version 9.3
@author 4GL Apps Ltd
@copyright 4GL Apps Ltd
**/
create table &curlib..mpe_datacatalog_CATS(
TX_FROM float format=datetime19.,
TX_TO float format=datetime19.,
libref char(8) label='Library Name',
memname char(64) label='Member Name',
constraint pk_mpe_datacatalog_CATS
primary key(libref,memname,tx_to));

View File

@@ -0,0 +1,21 @@
/**
@file mpe_datacatalog_CATS.ddl
@brief ddl file
@details
@version 9.3
@author 4GL Apps Ltd
@copyright 4GL Apps Ltd
**/
create table &curlib..mpe_datacatalog_OBJS(
TX_FROM float format=datetime19.,
TX_TO float format=datetime19.,
libref char(8) label='Library Name',
memname char(64) label='Member Name',
objname char(32) label='Object Name',
objtype char(8) label='Object Type',
objdesc char(256) label='Object Description',
alias char(32) label='Object Alias',
constraint pk_mpe_datacatalog_OBJS
primary key(libref,memname,objname,objtype,tx_to));

View File

@@ -0,0 +1,20 @@
/**
@file mpe_datacatalog_CATS.ddl
@brief ddl file
@details
@version 9.3
@author 4GL Apps Ltd
@copyright 4GL Apps Ltd
**/
create table &curlib..mpe_datastatus_CATS(
TX_FROM float format=datetime19.,
TX_TO float format=datetime19.,
libref char(8) label='Library Name',
memname char(64) label='Member Name',
nobjs num label='Number of objects',
created num format=DATETIME. label='Date Created',
modified num format=DATETIME. label='Date Modified',
constraint pk_mpe_datastatus_CATS
primary key(libref,memname,tx_to));

View File

@@ -14,5 +14,6 @@ create table &curlib..mpe_datastatus_libs(
libref char(8) label='Library Name',
libsize num format=SIZEKMG. label='Size of file',
table_cnt num label='Number of Tables',
catalog_cnt num label='Number of Catalogs',
constraint pk_mpe_datastatus_libs
primary key(libref,tx_to));

View File

@@ -0,0 +1,22 @@
/**
@file mpe_datacatalog_CATS.ddl
@brief ddl file
@details
@version 9.3
@author 4GL Apps Ltd
@copyright 4GL Apps Ltd
**/
create table &curlib..mpe_datastatus_OBJS(
TX_FROM float format=datetime19.,
TX_TO float format=datetime19.,
libref char(8) label='Library Name',
memname char(64) label='Member Name',
objname char(32) label='Object Name',
objtype char(8) label='Object Type',
created num format=DATETIME. label='Date Created',
modified num format=DATETIME. label='Date Modified',
level num label='Library Concatenation Level',
constraint pk_mpe_datastatus_OBJS
primary key(libref,memname,objname,objtype,tx_to));

View File

@@ -14,8 +14,8 @@ create table &curlib..mpe_datastatus_tabs(
libref char(8) label='Library Name',
dsn char(64) label='Member Name',
filesize num format=SIZEKMG. label='Size of file',
crdate num format=DATETIME. informat=DATETIME. label='Date Created',
modate num format=DATETIME. informat=DATETIME. label='Date Modified',
crdate num format=DATETIME. label='Date Created',
modate num format=DATETIME. label='Date Modified',
nobs num label='Number of Physical (Actual, inc. deleted) Observations',
constraint pk_mpe_datastatus_tabs
primary key(libref,dsn,tx_to));

View File

@@ -29,7 +29,7 @@ create table dc.mpe_datacatalog_TABS(
nvar num label='Number of Variables',
compress char(8) label='Compression Routine',
pk_fields char(512)
label='Primary Key Fields (identified by being in a constraint that is both Unique and Not Null)',
label='Primary Key Fields (in a constraint that is both Unique and Not Null)',
constraint pk
primary key(libref,dsn,tx_to));
@@ -67,8 +67,8 @@ create table dc.mpe_datacatalog_vars(
libref char(8) label='Library Name',
dsn char(64) label='Member Name',
filesize num format=SIZEKMG. label='Size of file',
crdate num format=DATETIME. informat=DATETIME. label='Date Created',
modate num format=DATETIME. informat=DATETIME. label='Date Modified',
crdate num format=DATETIME. label='Date Created',
modate num format=DATETIME. label='Date Modified',
nobs num label='Number of Physical (Actual, inc. deleted) Observations',
constraint pk
primary key(libref,dsn,tx_to));

View File

@@ -0,0 +1,71 @@
/**
@file
@brief migration script to move from v6.8.2 to v7.0 of data controller
BREAKING CHANGE - 1 new column and 4 additional tables for capturing catalogs
Be sure to run this using the correct system account
(eg the regular DC account)
On SAS 9 you may wish to run proc metalib or refresh in DI Studio afterwards
to see the new tables in the VIEW page
proc metalib;
omr (library="&DC_LIBNAME");
folder="&root/data";
update_rule=(delete);
run;
**/
%let dclib=YOURDCLIB;
libname &dclib "/YOUR/DATACONTROLLER/LIBRARY/PATH";
proc sql;
create table work.BACKUP as select * from &dclib..mpe_datastatus_libs;
alter table &dclib..mpe_datastatus_libs add catalog_cnt num;
create table &dclib..mpe_datacatalog_CATS(
TX_FROM float format=datetime19.,
TX_TO float format=datetime19.,
libref char(8) label='Library Name',
memname char(64) label='Member Name',
constraint pk_mpe_datacatalog_CATS
primary key(libref,memname,tx_to));
create table &dclib..mpe_datacatalog_OBJS(
TX_FROM float format=datetime19.,
TX_TO float format=datetime19.,
libref char(8) label='Library Name',
memname char(64) label='Member Name',
objname char(32) label='Object Name',
objtype char(8) label='Object Type',
objdesc char(256) label='Object Description',
alias char(32) label='Object Alias',
constraint pk_mpe_datacatalog_OBJS
primary key(libref,memname,objname,objtype,tx_to));
create table &dclib..mpe_datastatus_CATS(
TX_FROM float format=datetime19.,
TX_TO float format=datetime19.,
libref char(8) label='Library Name',
memname char(64) label='Member Name',
nobjs num label='Number of objects',
created num format=DATETIME. label='Date Created',
modified num format=DATETIME. label='Date Modified',
constraint pk_mpe_datastatus_CATS
primary key(libref,memname,tx_to));
create table &dclib..mpe_datastatus_OBJS(
TX_FROM float format=datetime19.,
TX_TO float format=datetime19.,
libref char(8) label='Library Name',
memname char(64) label='Member Name',
objname char(32) label='Object Name',
objtype char(8) label='Object Type',
created num format=DATETIME. label='Date Created',
modified num format=DATETIME. label='Date Modified',
level num label='Library Concatenation Level',
constraint pk_mpe_datastatus_OBJS
primary key(libref,memname,objname,objtype,tx_to));

View File

@@ -14,14 +14,31 @@
**/
%macro mpe_dsmeta(libds, outds=dsmeta);
%local ddsd ddld notes lenstmt;
%local ddsd ddld notes lenstmt memname;
%let lenstmt=length ods_table $18 name $100 value $1000;
%let libds=%upcase(&libds);
%mp_dsmeta(&libds, outds=&outds)
%if "%scan(&libds,2,-)" ne "FC" %then %do;
%let memname=%scan(&libds,2,.);
%mp_dsmeta(&libds, outds=&outds)
%end;
%else %do;
%let memname=%scan(&libds,2,.-);
data &outds;
&lenstmt;
set sashelp.vcatalg;
ods_table=cats(objtype);
name=cats(objname);
value=catx(' ',objdesc,'(modified:',put(modified,datetime19.),')');
where libname="%scan(&libds,1,.)" and memname="&memname";
keep ods_table name value;
run;
proc sort; by ods_table name;run;
%end;
data _null_;
set &mpelib..mpe_datadictionary;
where &dc_dttmtfmt < tx_to & dd_source=%upcase("&libds") & dd_type='TABLE';
where &dc_dttmtfmt < tx_to & dd_source="&memname" & dd_type='TABLE';
call symputx('ddsd',dd_shortdesc,'l');
call symputx('ddld',dd_longdesc,'l');
run;

View File

@@ -34,4 +34,15 @@ run;
outds=work.test_results
)
%mpe_dsmeta(FMTONLY.DCFMTS-FC,outds=test2)
data work.test2;
set work.test2;
putlog (_all_)(=);
run;
%mp_assertdsobs(work.test2,
desc=Test 2 - records returned,
test=EQUALS 5,
outds=work.test_results
)

View File

@@ -106,6 +106,19 @@ proc datasets lib=&lib noprint;
/nomiss unique;
quit;
proc sql;
create table &lib..mpe_datacatalog_CATS(
TX_FROM float &notnull format=datetime19.,
TX_TO float format=datetime19.,
libref char(8) label='Library Name',
memname char(64) label='Member Name'
);quit;
proc datasets lib=&lib noprint;
modify mpe_datacatalog_CATS;
index create
pk_mpe_datacatalog_CATS=(tx_to libref memname)
/nomiss unique;
quit;
proc sql;
create table &lib..mpe_datacatalog_libs(
TX_FROM num &notnull format=datetime19.3,
TX_TO num &notnull format=datetime19.3,
@@ -125,6 +138,23 @@ proc datasets lib=&lib noprint;
/nomiss unique;
quit;
proc sql;
create table &lib..mpe_datacatalog_OBJS(
TX_FROM num &notnull format=datetime19.,
TX_TO num &notnull format=datetime19.,
libref char(8) &notnull label='Library Name',
memname char(64) &notnull label='Member Name',
objname char(32) &notnull label='Object Name',
objtype char(8) &notnull label='Object Type',
objdesc char(256) label='Object Description',
alias char(32) label='Object Alias'
);quit;
proc datasets lib=&lib noprint;
modify mpe_datacatalog_OBJS;
index create
pk_mpe_datacatalog_OBJS=(libref memname objname objtype tx_to)
/nomiss unique;
quit;
proc sql;
create table &lib..mpe_datacatalog_TABS(
TX_FROM num &notnull format=datetime19.3,
TX_TO num &notnull format=datetime19.3,
@@ -137,7 +167,7 @@ create table &lib..mpe_datacatalog_TABS(
nvar num label='Number of Variables',
compress char(8) label='Compression Routine',
pk_fields char(512)
label='Primary Key Fields (identified by being in a constraint that is both Unique and Not Null)'
label='Primary Key Fields - in a constraint being both Unique and Not Null'
);quit;
proc datasets lib=&lib noprint;
modify mpe_datacatalog_TABS;
@@ -169,12 +199,29 @@ proc datasets lib=&lib noprint;
/nomiss unique;
quit;
proc sql;
create table &lib..mpe_datastatus_CATS(
TX_FROM float format=datetime19.,
TX_TO float format=datetime19.,
libref char(8) label='Library Name',
memname char(64) label='Member Name',
nobjs num &notnull label='Number of objects',
created num &notnull format=DATETIME. label='Date Created',
modified num format=DATETIME. label='Date Modified'
);quit;
proc datasets lib=&lib noprint;
modify mpe_datastatus_CATS;
index create
pk_mpe_datastatus_cats=(libref memname tx_to)
/nomiss unique;
quit;
proc sql;
create table &lib..mpe_datastatus_libs(
TX_FROM num &notnull format=datetime19.3,
TX_TO num &notnull format=datetime19.3,
libref char(8) label='Library Name',
libsize num format=SIZEKMG. label='Size of library',
table_cnt num label='Number of Tables'
table_cnt num label='Number of Tables',
catalog_cnt num label='Number of Catalogs'
);quit;
proc datasets lib=&lib noprint;
modify mpe_datastatus_libs;
@@ -183,14 +230,32 @@ proc datasets lib=&lib noprint;
/nomiss unique;
quit;
proc sql;
create table &lib..mpe_datastatus_OBJS(
TX_FROM float &notnull format=datetime19.,
TX_TO float &notnull format=datetime19.,
libref char(8) label='Library Name',
memname char(64) label='Member Name',
objname char(32) label='Object Name',
objtype char(8) label='Object Type',
created num &notnull format=DATETIME. label='Date Created',
modified num format=DATETIME. label='Date Modified',
level num label='Library Concatenation Level'
);quit;
proc datasets lib=&lib noprint;
modify mpe_datastatus_OBJS;
index create
pk_mpe_datastatus_OBJS=(libref memname objname objtype tx_to)
/nomiss unique;
quit;
proc sql;
create table &lib..mpe_datastatus_tabs(
TX_FROM num &notnull format=datetime19.3,
TX_TO num &notnull format=datetime19.3,
libref char(8) label='Library Name',
dsn char(64) label='Member Name',
filesize num format=SIZEKMG. label='Size of file',
crdate num format=DATETIME. informat=DATETIME. label='Date Created',
modate num format=DATETIME. informat=DATETIME. label='Date Modified',
crdate num format=DATETIME. label='Date Created',
modate num format=DATETIME. label='Date Modified',
nobs num label='Number of Physical (Actual, inc. deleted) Observations'
);quit;
proc datasets lib=&lib noprint;

View File

@@ -0,0 +1,26 @@
/**
@file
@brief Testing mpe_refreshtables macro
<h4> SAS Macros </h4>
@li mpe_makedatamodel.sas
@li mp_assert.sas
@li mp_assertscope.sas
@author 4GL Apps Ltd
@copyright 4GL Apps Ltd. This code may only be used within Data Controller
and may not be re-distributed or re-sold without the express permission of
4GL Apps Ltd.
**/
%mp_assertscope(SNAPSHOT)
%mpe_makedatamodel(lib=WORK)
%mp_assertscope(COMPARE,
desc=Checking macro variables against previous snapshot
)
%mp_assert(
iftrue=(&syscc = 0),
desc=Checking error condition
)

View File

@@ -0,0 +1,140 @@
/**
@file mpe_refreshtables.sas
@brief Refreshes the data catalog
@details Assumes library is already assigned.
Usage:
%mpe_refreshcatalogs(sashelp)
<h4> SAS Macros </h4>
@li bitemporal_dataloader.sas
@version 9.3
@author 4GL Apps Ltd
**/
%macro mpe_refreshcatalogs(lib,cat=#all);
%let lib=%upcase(&lib);
%let cat=%upcase(&cat);
%put running &sysmacroname &lib for &cat;
proc sql;
create table work.catdata as
select libname as libref,
memname,
objname,
objtype,
objdesc,
created,
modified,
alias,
level
from dictionary.catalogs
where upcase(libname)="&lib"
%if &cat ne #ALL %then %do;
and upcase(memname)="&cat"
%end;
;
%mp_abort(iftrue= (&syscc ne 0)
,mac=&_program
,msg=%str(syscc=&syscc afer &lib objects extraction)
)
/* load mpe_datacatalog_CATS */
proc sql;
create table datacats as select distinct libref,memname from catdata;
%bitemporal_dataloader(base_lib=&mpelib
,base_dsn=mpe_datacatalog_CATS
,append_dsn=datacats
,PK=LIBREF MEMNAME
,etlsource=&sysmacroname
,loadtype=TXTEMPORAL
,tech_from=TX_FROM
,tech_to=TX_TO
%if &cat = #ALL %then %do;
,close_vars=LIBREF
%end;
,dclib=&mpelib
)
/* load mpe_datacatalog_objsS */
proc sql;
create table dataobjs as
select distinct libref,
memname,
objname,
objtype,
objdesc,
alias
from catdata;
quit;
%bitemporal_dataloader(base_lib=&mpelib
,base_dsn=mpe_datacatalog_OBJS
,append_dsn=dataobjs
,PK=LIBREF MEMNAME OBJNAME OBJTYPE
,etlsource=&sysmacroname
,loadtype=TXTEMPORAL
,tech_from=TX_FROM
,tech_to=TX_TO
%if &cat = #ALL %then %do;
,close_vars=LIBREF MEMNAME
%end;
,dclib=&mpelib
)
%put load mpe_datastatus_OBJS;
proc sql;
create table statusobjs as
select distinct libref,
memname,
objname,
objtype,
created,
modified,
level
from catdata;
%bitemporal_dataloader(base_lib=&mpelib
,base_dsn=mpe_datastatus_OBJS
,append_dsn=statusobjs
,PK=LIBREF MEMNAME OBJNAME OBJTYPE
,etlsource=&sysmacroname
,loadtype=TXTEMPORAL
,tech_from=TX_FROM
,tech_to=TX_TO
%if &cat = #ALL %then %do;
,close_vars=LIBREF MEMNAME
%end;
,dclib=&mpelib
)
%put load mpe_datastatus_cats;
proc sql;
create table statuscats as
select libref,
memname,
count(*) as nobjs,
min(created) as created,
max(modified) as modified
from catdata
group by 1,2;
%bitemporal_dataloader(base_lib=&mpelib
,base_dsn=mpe_datastatus_cats
,append_dsn=statuscats
,PK=LIBREF MEMNAME
,etlsource=&sysmacroname
,loadtype=TXTEMPORAL
,tech_from=TX_FROM
,tech_to=TX_TO
%if &cat = #ALL %then %do;
,close_vars=LIBREF
%end;
,dclib=&mpelib
)
%mend mpe_refreshcatalogs;

View File

@@ -0,0 +1,38 @@
/**
@file
@brief Testing mpe_refreshcatalogs macro
<h4> SAS Macros </h4>
@li mpe_refreshcatalogs.sas
@li mp_assert.sas
@li mp_assertscope.sas
@li mp_ds2md.sas
@author 4GL Apps Ltd
@copyright 4GL Apps Ltd. This code may only be used within Data Controller
and may not be re-distributed or re-sold without the express permission of
4GL Apps Ltd.
**/
%mp_assertscope(SNAPSHOT)
%mpe_refreshcatalogs(FMTONLY)
%mp_assertscope(COMPARE,
desc=Checking macro variables against previous snapshot
)
/* make sure that the process picks up the catalog */
proc sql noprint;
create table work.test1 as
select *
from &mpelib..mpe_datacatalog_cats(where=(&dc_dttmtfmt. lt tx_to))
where libref="FMTONLY";
%let test1=0;
select count(*) into: test1 from work.test1;
%mp_assert(
iftrue=(&test1>0),
desc=Checking fmtonly.dcfmts was picked up
)
%mp_ds2md(work.test1)

View File

@@ -48,11 +48,6 @@ create table cols as
,msg=%str(syscc=&syscc afer &lib cols extraction)
)
%mp_abort(iftrue= (&syscc ne 0)
,mac=&_program
,msg=%str(syscc=&syscc afer &lib indexes extraction)
)
%if &engine=SQLSVR %then %do;
proc sql;
connect using &lib;
@@ -175,6 +170,11 @@ create table cols as
%end;
%mp_abort(iftrue= (&syscc ne 0)
,mac=&_program
,msg=%str(syscc=&syscc afer &lib indexes extraction)
)
/* load columns */
%bitemporal_dataloader(base_lib=&mpelib
,base_dsn=mpe_datacatalog_vars
@@ -295,7 +295,7 @@ proc sql;
%if &ds ne #ALL %then %do;
and upcase(memname)="&ds"
%end;
;
;
%end;
%bitemporal_dataloader(base_lib=&mpelib
@@ -314,12 +314,26 @@ proc sql;
%if &ds = #ALL %then %do;
proc sql;
create table statuslibs as select
create table work.sumcat as
select libname as libref,
count(distinct memname) as catalog_cnt
from dictionary.catalogs
where upcase(libname)="&lib"
group by 1;
create table work.sumdsn as select
libref
,sum(filesize) as libsize
,count(*) as table_cnt
from statustabs
group by 1;
create table work.statuslibs as
select coalesce(a.libref,b.libref) as libref,
a.libsize,
a.table_cnt,
b.catalog_cnt
from work.sumdsn a
full join work.sumcat b
on a.libref=b.libref;
%bitemporal_dataloader(base_lib=&mpelib
,base_dsn=mpe_datastatus_libs

View File

@@ -0,0 +1,50 @@
/**
@file
@brief Testing mpe_refreshtables macro
<h4> SAS Macros </h4>
@li mpe_refreshtables.sas
@li mp_assert.sas
@li mp_assertscope.sas
@author 4GL Apps Ltd
@copyright 4GL Apps Ltd. This code may only be used within Data Controller
and may not be re-distributed or re-sold without the express permission of
4GL Apps Ltd.
**/
%mp_assertscope(SNAPSHOT)
%mpe_refreshtables(FMTONLY)
%mp_assertscope(COMPARE,
desc=Checking macro variables against previous snapshot
)
/* make sure that the process picks up a library that contains only a single
catalog */
proc sql;
create table work.libinfo as
select a.engine,
a.libname,
a.paths,
a.perms,
a.owners,
a.schemas,
a.libid,
b.libsize,
b.table_cnt,
b.catalog_cnt
from &mpelib..mpe_datacatalog_libs(where=(&dc_dttmtfmt. lt tx_to)) a
left join &mpelib..mpe_datastatus_libs(where=(&dc_dttmtfmt. lt tx_to)) b
on a.libref=b.libref
where a.libref="&libref";
%let test1=0;
data _null_;
set work.libinfo;
call symputx('test1',table_cnt);
run;
%mp_assert(
iftrue=(&test1>0),
desc=Checking fmtonly.dcfmts was picked up
)

View File

@@ -94,38 +94,41 @@
},
{
"name": "viya",
"serverUrl": "https://sas.4gl.io",
"serverUrl": "https://viya-f0g8ht62vq.engage.sas.com",
"serverType": "SASVIYA",
"httpsAgentOptions": {
"allowInsecureRequests": false
},
"appLoc": "/Public/app/dcplaceholder",
"deployConfig": {
"deployServicePack": true,
"deployScripts": [
"sasjs/utils/viyadeploy.sh"
]
},
"macroFolders": [
"sasjs/targets/viya/macros_viya"
],
"programFolders": [
"sasjs/db/datactrl"
],
"binaryFolders": [],
"buildConfig": {
"initProgram": "sasjs/utils/buildinitviya.sas",
"buildResultsFolder": "sasjsresults",
"buildOutputFolder": "sasjsbuild",
"buildOutputFileName": "viya.sas"
"buildOutputFileName": "viya.sas",
"termProgram": "",
"macroVars": {}
},
"serviceConfig": {
"initProgram": "sasjs/utils/serviceinitviya.sas",
"serviceFolders": [
"sasjs/targets/viya/services_viya/viya_users",
"sasjs/targets/viya/services_viya/admin",
"sasjs/targets/viya/services_viya/public"
]
},
"deployConfig": {
"deployServicePack": true,
"deployScripts": [
"sasjs/utils/viyadeploy.sh"
]
],
"initProgram": "sasjs/utils/serviceinitviya.sas",
"termProgram": "",
"macroVars": {}
},
"streamConfig": {
"streamWeb": true,
@@ -137,54 +140,6 @@
},
"contextName": "SAS Job Execution compute context"
},
{
"name": "viyacloud",
"serverUrl": "https://4gl.viyacloud.sas.com",
"serverType": "SASVIYA",
"httpsAgentOptions": {
"rejectUnauthorized": false,
"allowInsecureRequests": true
},
"appLoc": "/30.SASApps/app/dc",
"macroFolders": [
"sasjs/targets/viya/macros_viya"
],
"programFolders": [
"sasjs/db/datactrl"
],
"buildConfig": {
"initProgram": "sasjs/utils/buildinitviya.sas",
"termProgram": "sasjs/utils/buildtermviya.sas",
"macroVars": {
"dcpath": "/opt/sas/viya/config/var/tmp/dc",
"adminGroup": "DataBuilders"
},
"buildResultsFolder": "sasjsresults",
"buildOutputFolder": "sasjsbuild",
"buildOutputFileName": "viya.sas"
},
"serviceConfig": {
"initProgram": "sasjs/utils/serviceinitviya.sas",
"serviceFolders": [
"sasjs/targets/viya/services_viya/viya_users",
"sasjs/targets/viya/services_viya/admin",
"sasjs/targets/viya/services_viya/public"
],
"termProgram": "",
"macroVars": {}
},
"streamConfig": {
"streamWeb": true,
"streamWebFolder": "webv",
"webSourcePath": "../client/dist",
"streamServiceName": "clickme",
"assetPaths": []
},
"deployConfig": {
"deployServicePack": true
},
"contextName": "Datacontroller compute context"
},
{
"name": "vtest",
"appLoc": "/30.SASApps/app/vtest",

View File

@@ -675,7 +675,7 @@ data xl_rules;
keep xl_column xl_rule;
run;
%mpe_dsmeta(&libds, outds=dsmeta)
%mpe_dsmeta(&orig_libds, outds=dsmeta)
%mpe_getversions(&mpelib,
%scan(&orig_libds,1,.),

View File

@@ -54,7 +54,10 @@ data _null_;
/* if a TXTEMPORAL table then filter as such */
call symputx('txfrom',var_txfrom);
call symputx('txto',var_txto);
run;
/* if a format, extract relevant info */
data _null_;
ds=symget('ds');
is_fmt=0;
if subpad(cats(reverse(ds)),1,3)=:'CF-' then do;

View File

@@ -76,3 +76,37 @@ run;
test=EQUALS 3,
outds=work.test_results
)
/* test 3 - when there is a format catalog / nothing else in the library */
data work.params3;
length name $32 value $1000;
name='type';value='SAS';output;
name='table';value="FMTONLY.DCFMTS-FC";output;
name='filter';value='0';output;
run;
%mx_testservice(&_program,
viyacontext=&defaultcontext,
inputparams=work.params3,
outref=web3,
viyaresult=WEBOUT_TXT
)
data work.results3;
infile web3;
input;
putlog _infile_;
if _infile_=:'datalines4;' then do;
output;
output;
output;
stop;
end;
if _n_>100 then stop;
run;
%mp_assertdsobs(work.results3,
desc=datalines file is successfully returned for LONE format catalog,
test=EQUALS 3,
outds=work.test_results
)

View File

@@ -1,85 +1,86 @@
/**
@file refreshlibinfo.sas
@brief Refresh the Data Catalog for a particular library
@details When showing library info in the VIEW menu, the data is taken from
the Data Catalog tables. These may be empty or outdated, and so this service
allows end users to run a refresh of the data.
<h4> Service Inputs </h4>
<h5> lib2refresh </h5>
Should contain the libref to be refreshed.
|libref:$8.|
|---|
|SOMELIB|
<h4> Service Outputs </h4>
<h5> libinfo </h5>
|engine $|libname $|paths $|perms $|owners $|schemas $ |libid $|libsize $|table_cnt |
|---|---|---|---|---|---|---|---|---|
|V9|SOMELIB|"some/path"|rwxrwxr-x|sassrv|` `|` `|636MB|33|
<h4> SAS Macros </h4>
@li dc_assignlib.sas
@li dc_refreshcatalog.sas
@li mp_abort.sas
@version 9.3
@author 4GL Apps Ltd
@copyright 4GL Apps Ltd. This code may only be used within Data Controller
and may not be re-distributed or re-sold without the express permission of
4GL Apps Ltd.
**/
%mpeinit()
%webout(FETCH)
%mp_abort(iftrue= (&syscc ne 0)
,msg=%str(syscc=&syscc Problem on startup)
)
%let libref=;
data _null_;
set work.lib2refresh;
call symputx('libref',libref);
run;
%mp_abort(iftrue= (&syscc ne 0)
,msg=%str(syscc=&syscc Problem with inputs - was lib2refresh object sent?)
)
%dc_assignlib(WRITE,&libref)
%mp_abort(iftrue= (&syscc ne 0)
,msg=%str(syscc=&syscc after lib assignment)
)
%dc_refreshcatalog(&libref)
%mp_abort(iftrue= (&syscc ne 0)
,msg=%str(syscc=&syscc Problem when running the catalog refresh)
)
/* get libinfo */
proc sql;
create table work.libinfo as
select a.engine,
a.libname,
a.paths,
a.perms,
a.owners,
a.schemas,
a.libid,
b.libsize,
b.table_cnt
from &mpelib..mpe_datacatalog_libs(where=(&dc_dttmtfmt. lt tx_to)) a
inner join &mpelib..mpe_datastatus_libs(where=(&dc_dttmtfmt. lt tx_to)) b
on a.libref=b.libref
where a.libref="&libref";
%webout(OPEN)
%webout(OBJ,libinfo)
%webout(CLOSE)
/**
@file refreshlibinfo.sas
@brief Refresh the Data Catalog for a particular library
@details When showing library info in the VIEW menu, the data is taken from
the Data Catalog tables. These may be empty or outdated, and so this service
allows end users to run a refresh of the data.
<h4> Service Inputs </h4>
<h5> lib2refresh </h5>
Should contain the libref to be refreshed.
|libref:$8.|
|---|
|SOMELIB|
<h4> Service Outputs </h4>
<h5> libinfo </h5>
|engine $|libname $|paths $|perms $|owners $|schemas $ |libid $|libsize $|table_cnt |
|---|---|---|---|---|---|---|---|---|
|V9|SOMELIB|"some/path"|rwxrwxr-x|sassrv|` `|` `|636MB|33|
<h4> SAS Macros </h4>
@li dc_assignlib.sas
@li dc_refreshcatalog.sas
@li mp_abort.sas
@version 9.3
@author 4GL Apps Ltd
@copyright 4GL Apps Ltd. This code may only be used within Data Controller
and may not be re-distributed or re-sold without the express permission of
4GL Apps Ltd.
**/
%mpeinit()
%webout(FETCH)
%mp_abort(iftrue= (&syscc ne 0)
,msg=%str(syscc=&syscc Problem on startup)
)
%let libref=;
data _null_;
set work.lib2refresh;
call symputx('libref',libref);
run;
%mp_abort(iftrue= (&syscc ne 0)
,msg=%str(syscc=&syscc Problem with inputs - was lib2refresh object sent?)
)
%dc_assignlib(WRITE,&libref)
%mp_abort(iftrue= (&syscc ne 0)
,msg=%str(syscc=&syscc after lib assignment)
)
%dc_refreshcatalog(&libref)
%mp_abort(iftrue= (&syscc ne 0)
,msg=%str(syscc=&syscc Problem when running the catalog refresh)
)
/* get libinfo */
proc sql;
create table work.libinfo as
select a.engine,
a.libname,
a.paths,
a.perms,
a.owners,
a.schemas,
a.libid,
b.libsize,
b.table_cnt,
b.catalog_cnt
from &mpelib..mpe_datacatalog_libs(where=(&dc_dttmtfmt. lt tx_to)) a
inner join &mpelib..mpe_datastatus_libs(where=(&dc_dttmtfmt. lt tx_to)) b
on a.libref=b.libref
where a.libref="&libref";
%webout(OPEN)
%webout(OBJ,libinfo)
%webout(CLOSE)

View File

@@ -355,7 +355,7 @@ run;
%mp_getcols(&libds, outds=cols)
%mpe_dsmeta(&libds, outds=dsmeta)
%mpe_dsmeta(&orig_libds, outds=dsmeta)
%mpe_getversions(&mpelib,
%scan(&orig_libds,1,.),

View File

@@ -167,7 +167,8 @@ create table work.libinfo as
a.schemas,
a.libid,
coalesce(b.libsize,0) as libsize,
coalesce(b.table_cnt,0) as table_cnt
coalesce(b.table_cnt,0) as table_cnt,
coalesce(b.catalog_cnt,0) as catalog_cnt
from &mpelib..mpe_datacatalog_libs(where=(&dc_dttmtfmt. lt tx_to)) a
left join &mpelib..mpe_datastatus_libs(where=(&dc_dttmtfmt. lt tx_to)) b
on a.libref=b.libref

View File

@@ -9,6 +9,7 @@
<h4> SAS Macros </h4>
@li mpe_refreshlibs.sas
@li dc_assignlib.sas
@li mpe_refreshcatalogs.sas
@li mpe_refreshtables.sas
@li mm_getrepos.sas
@@ -44,6 +45,7 @@ run;
%dc_assignlib(WRITE,&libref) /* write just in order to assign direct lib */
%mpe_refreshlibs(lib=&libref)
%mpe_refreshtables(&libref)
%mpe_refreshcatalogs(&libref)
%end;
%else %do xx=1 %to &repocnt;
options metarepository=&&repo&xx;
@@ -73,6 +75,7 @@ run;
%do i=1 %to &libcnt;
%dc_assignlib(WRITE,&&lib&i)
%mpe_refreshtables(&&lib&i)
%mpe_refreshcatalogs(&&lib&i)
%end;
%end;

View File

@@ -9,6 +9,7 @@
<h4> SAS Macros </h4>
@li mpe_refreshlibs.sas
@li dc_assignlib.sas
@li mpe_refreshcatalogs.sas
@li mpe_refreshtables.sas
@@ -34,6 +35,8 @@ data libraries;
str=cats('%mpe_refreshtables(',libref,')');
put str;
putlog str;
str=cats('%mpe_refreshcatalogs(',libref,')');
put str;
run;
%inc executor/source2;

View File

@@ -10,6 +10,7 @@
@li mpe_refreshlibs.sas
@li dc_assignlib.sas
@li mpe_refreshtables.sas
@li mpe_refreshcatalogs.sas
@version 3.4
@@ -19,19 +20,29 @@
4GL Apps Ltd.
**/
%macro dc_refreshcatalog();
%macro dc_refreshcatalog(libref);
%mpe_refreshlibs()
filename executor catalog 'work.code.code.source';
data libraries;
set &mpelib..mpe_datacatalog_libs;
where &dc_dttmtfmt. le TX_TO;
file executor;
str=cats('%mpe_refreshtables(',libref,')');
put str;
putlog str;
run;
%inc executor;
%if #&libref# ne ## %then %do;
%put &sysmacroname: assigning specific libref, &libref;
%dc_assignlib(WRITE,&libref) /* write just in order to assign direct lib */
%mpe_refreshlibs(lib=&libref)
%mpe_refreshtables(&libref)
%mpe_refreshcatalogs(&libref)
%end;
%else %do;
%mpe_refreshlibs()
filename executor catalog 'work.code.code.source';
data libraries;
set &mpelib..mpe_datacatalog_libs;
where &dc_dttmtfmt. le TX_TO;
file executor;
str=cats('%mpe_refreshtables(',libref,')');
put str;
str=cats('%mpe_refreshcatalogs(',libref,')');
put str;
putlog str;
run;
%inc executor;
%end;
%mend dc_refreshcatalog;

View File

@@ -21,7 +21,7 @@ REMOVE THAT LAST MACRO
%let syscc=0;
%global apploc _program dclib defaultcontext _debug sasjs_mdebug dc_dttmtfmt;
%let defaultcontext=Datacontroller compute context;
%let defaultcontext=SAS Job Execution compute context;
%let sasjs_mdebug=0;
options mprint mprintnest nobomfile lrecl=32767;

View File

@@ -28,7 +28,7 @@
%global apploc _program;
%let defaultcontext=Datacontroller compute context;
%let defaultcontext=SAS Job Execution compute context;
data _null_;
length _pgm $1000;
@@ -60,6 +60,9 @@ run;
%let testloc=%sysfunc(pathname(&DC_LIBREF))/fmt%mf_getuniquefileref();
%mf_mkdir(&testloc)
libname dctest "&testloc";
/* test library with only one format catalog */
%mf_mkdir(&testloc/fmtonly)
libname fmtonly "&testloc/fmtonly";
/* add formats */
PROC FORMAT library=dctest.dcfmts;
@@ -99,6 +102,10 @@ run;
proc append base=&dc_libref..mpe_tables data=work.append;
run;
/* lone format catalog */
proc format cntlin=work.fmts library=fmtonly.dcfmts;
run;
/* add some other tables */
%mp_coretable(LOCKTABLE,libds=dctest.locktable)
%mp_coretable(DIFFTABLE,libds=dctest.difftable)
@@ -130,6 +137,7 @@ options mprint;
put _infile_;
if last then do;
put "libname dctest '&testloc';";
put "libname fmtonly '&testloc/fmtonly';";
end;
run;
data _null_;
@@ -151,6 +159,7 @@ options mprint;
put _infile_;
if last then do;
put "libname dctest '&testloc';";
put "libname fmtonly '&testloc/fmtonly';";
end;
run;
%ms_deletefile(&root/services/public/settings.sas)
@@ -182,6 +191,7 @@ options mprint;
put _infile_;
if last then do;
put "libname dctest '&testloc';";
put "libname fmtonly '&testloc/fmtonly';";
end;
run;
%mm_deletestp(target=&root/services/public/Data_Controller_Settings)

View File

@@ -2,6 +2,11 @@
@file buildinitviya.sas
@brief initialisation for viya build program
<h4> SAS Macros </h4>
@li mfv_getfolderpath.sas
@li mfv_getpathuri.sas
@li mv_createfolder.sas
**/
options nonotes nomprint;
@@ -9,4 +14,8 @@ options nonotes nomprint;
/* update apploc to default to user home area if not set */
%let apploc=%sysfunc(ifc("&apploc"="/Public/app/dcplaceholder"
,/Users/&sysuserid/My Folder/Data Controller
,&apploc));
,&apploc));
/* ensure the correct casing of appLoc */
%mv_createfolder(path=&apploc)
%let apploc=%mfv_getfolderpath(%mfv_getpathuri(&apploc));