mirror of
https://github.com/sasjs/core.git
synced 2025-12-10 14:04:36 +00:00
fix: ensuring consistent column names across invocations in output dataset
This commit is contained in:
17
all.sas
17
all.sas
@@ -29553,7 +29553,7 @@ Usage:
|
||||
Valid values are "password" or "authorization_code" (unquoted).
|
||||
@param [out] outds= (work.mx_getgroups) This output dataset will contain the
|
||||
list of groups. Format:
|
||||
|NAME:$32.|DESCRIPTION:$256.|GROUPID:best.|
|
||||
|GROUPNAME:$32.|GROUPDESC:$256.|GROUPURI:best.|
|
||||
|---|---|---|
|
||||
|`SomeGroup `|`A group `|`1`|
|
||||
|`Another Group`|`this is a different group`|`2`|
|
||||
@@ -29587,6 +29587,15 @@ Usage:
|
||||
outds=&outds,
|
||||
mdebug=&mdebug
|
||||
)
|
||||
data &outds;
|
||||
length groupuri groupname $32 groupdesc $128 ;
|
||||
set &outds;
|
||||
keep groupuri groupname groupdesc;
|
||||
groupuri=cats(groupid);
|
||||
groupname=name;
|
||||
groupdesc=description;
|
||||
run;
|
||||
proc sort; by groupname; run;
|
||||
%end;
|
||||
%else %if &platform=SAS9 or &platform=SASMETA %then %do;
|
||||
%if &user=0 %then %let user=;
|
||||
@@ -29596,6 +29605,7 @@ Usage:
|
||||
,repo=&repo
|
||||
,mDebug=&mdebug
|
||||
)
|
||||
proc sort data=&outds; by groupname; run;
|
||||
%end;
|
||||
%else %if &platform=SASVIYA %then %do;
|
||||
%if &user=0 %then %do;
|
||||
@@ -29611,6 +29621,11 @@ Usage:
|
||||
,grant_type=&grant_type
|
||||
)
|
||||
%end;
|
||||
proc sort
|
||||
data=&outds(rename=(id=groupuri name=groupname description=groupdesc))
|
||||
out=&outds (keep=groupuri groupname groupdesc);
|
||||
by groupname;
|
||||
run;
|
||||
%end;
|
||||
|
||||
%mend mx_getgroups;/**
|
||||
|
||||
@@ -21,6 +21,11 @@
|
||||
desc=groups were found,
|
||||
outds=work.test_results
|
||||
)
|
||||
%mp_assertcols(work.test1,
|
||||
cols=groupuri groupname groupdesc,
|
||||
test=ALL,
|
||||
desc=check all columns exist
|
||||
)
|
||||
|
||||
%mx_getgroups(outds=work.test2,user=%mf_getuser())
|
||||
|
||||
@@ -28,4 +33,9 @@
|
||||
iftrue=(%mf_nobs(work.test2)>0),
|
||||
desc=groups for current user were found,
|
||||
outds=work.test_results
|
||||
)
|
||||
%mp_assertcols(work.test2,
|
||||
cols=groupuri groupname groupdesc,
|
||||
test=ALL,
|
||||
desc=check all columns exist
|
||||
)
|
||||
@@ -20,7 +20,7 @@
|
||||
Valid values are "password" or "authorization_code" (unquoted).
|
||||
@param [out] outds= (work.mx_getgroups) This output dataset will contain the
|
||||
list of groups. Format:
|
||||
|NAME:$32.|DESCRIPTION:$256.|GROUPID:best.|
|
||||
|GROUPNAME:$32.|GROUPDESC:$256.|GROUPURI:best.|
|
||||
|---|---|---|
|
||||
|`SomeGroup `|`A group `|`1`|
|
||||
|`Another Group`|`this is a different group`|`2`|
|
||||
@@ -54,6 +54,15 @@
|
||||
outds=&outds,
|
||||
mdebug=&mdebug
|
||||
)
|
||||
data &outds;
|
||||
length groupuri groupname $32 groupdesc $128 ;
|
||||
set &outds;
|
||||
keep groupuri groupname groupdesc;
|
||||
groupuri=cats(groupid);
|
||||
groupname=name;
|
||||
groupdesc=description;
|
||||
run;
|
||||
proc sort; by groupname; run;
|
||||
%end;
|
||||
%else %if &platform=SAS9 or &platform=SASMETA %then %do;
|
||||
%if &user=0 %then %let user=;
|
||||
@@ -63,6 +72,7 @@
|
||||
,repo=&repo
|
||||
,mDebug=&mdebug
|
||||
)
|
||||
proc sort data=&outds; by groupname; run;
|
||||
%end;
|
||||
%else %if &platform=SASVIYA %then %do;
|
||||
%if &user=0 %then %do;
|
||||
@@ -78,6 +88,11 @@
|
||||
,grant_type=&grant_type
|
||||
)
|
||||
%end;
|
||||
proc sort
|
||||
data=&outds(rename=(id=groupuri name=groupname description=groupdesc))
|
||||
out=&outds (keep=groupuri groupname groupdesc);
|
||||
by groupname;
|
||||
run;
|
||||
%end;
|
||||
|
||||
%mend mx_getgroups;
|
||||
Reference in New Issue
Block a user