mirror of
https://github.com/sasjs/core.git
synced 2025-12-10 22:14:35 +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).
|
Valid values are "password" or "authorization_code" (unquoted).
|
||||||
@param [out] outds= (work.mx_getgroups) This output dataset will contain the
|
@param [out] outds= (work.mx_getgroups) This output dataset will contain the
|
||||||
list of groups. Format:
|
list of groups. Format:
|
||||||
|NAME:$32.|DESCRIPTION:$256.|GROUPID:best.|
|
|GROUPNAME:$32.|GROUPDESC:$256.|GROUPURI:best.|
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
|`SomeGroup `|`A group `|`1`|
|
|`SomeGroup `|`A group `|`1`|
|
||||||
|`Another Group`|`this is a different group`|`2`|
|
|`Another Group`|`this is a different group`|`2`|
|
||||||
@@ -29587,6 +29587,15 @@ Usage:
|
|||||||
outds=&outds,
|
outds=&outds,
|
||||||
mdebug=&mdebug
|
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;
|
%end;
|
||||||
%else %if &platform=SAS9 or &platform=SASMETA %then %do;
|
%else %if &platform=SAS9 or &platform=SASMETA %then %do;
|
||||||
%if &user=0 %then %let user=;
|
%if &user=0 %then %let user=;
|
||||||
@@ -29596,6 +29605,7 @@ Usage:
|
|||||||
,repo=&repo
|
,repo=&repo
|
||||||
,mDebug=&mdebug
|
,mDebug=&mdebug
|
||||||
)
|
)
|
||||||
|
proc sort data=&outds; by groupname; run;
|
||||||
%end;
|
%end;
|
||||||
%else %if &platform=SASVIYA %then %do;
|
%else %if &platform=SASVIYA %then %do;
|
||||||
%if &user=0 %then %do;
|
%if &user=0 %then %do;
|
||||||
@@ -29611,6 +29621,11 @@ Usage:
|
|||||||
,grant_type=&grant_type
|
,grant_type=&grant_type
|
||||||
)
|
)
|
||||||
%end;
|
%end;
|
||||||
|
proc sort
|
||||||
|
data=&outds(rename=(id=groupuri name=groupname description=groupdesc))
|
||||||
|
out=&outds (keep=groupuri groupname groupdesc);
|
||||||
|
by groupname;
|
||||||
|
run;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%mend mx_getgroups;/**
|
%mend mx_getgroups;/**
|
||||||
|
|||||||
@@ -21,6 +21,11 @@
|
|||||||
desc=groups were found,
|
desc=groups were found,
|
||||||
outds=work.test_results
|
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())
|
%mx_getgroups(outds=work.test2,user=%mf_getuser())
|
||||||
|
|
||||||
@@ -29,3 +34,8 @@
|
|||||||
desc=groups for current user were found,
|
desc=groups for current user were found,
|
||||||
outds=work.test_results
|
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).
|
Valid values are "password" or "authorization_code" (unquoted).
|
||||||
@param [out] outds= (work.mx_getgroups) This output dataset will contain the
|
@param [out] outds= (work.mx_getgroups) This output dataset will contain the
|
||||||
list of groups. Format:
|
list of groups. Format:
|
||||||
|NAME:$32.|DESCRIPTION:$256.|GROUPID:best.|
|
|GROUPNAME:$32.|GROUPDESC:$256.|GROUPURI:best.|
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
|`SomeGroup `|`A group `|`1`|
|
|`SomeGroup `|`A group `|`1`|
|
||||||
|`Another Group`|`this is a different group`|`2`|
|
|`Another Group`|`this is a different group`|`2`|
|
||||||
@@ -54,6 +54,15 @@
|
|||||||
outds=&outds,
|
outds=&outds,
|
||||||
mdebug=&mdebug
|
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;
|
%end;
|
||||||
%else %if &platform=SAS9 or &platform=SASMETA %then %do;
|
%else %if &platform=SAS9 or &platform=SASMETA %then %do;
|
||||||
%if &user=0 %then %let user=;
|
%if &user=0 %then %let user=;
|
||||||
@@ -63,6 +72,7 @@
|
|||||||
,repo=&repo
|
,repo=&repo
|
||||||
,mDebug=&mdebug
|
,mDebug=&mdebug
|
||||||
)
|
)
|
||||||
|
proc sort data=&outds; by groupname; run;
|
||||||
%end;
|
%end;
|
||||||
%else %if &platform=SASVIYA %then %do;
|
%else %if &platform=SASVIYA %then %do;
|
||||||
%if &user=0 %then %do;
|
%if &user=0 %then %do;
|
||||||
@@ -78,6 +88,11 @@
|
|||||||
,grant_type=&grant_type
|
,grant_type=&grant_type
|
||||||
)
|
)
|
||||||
%end;
|
%end;
|
||||||
|
proc sort
|
||||||
|
data=&outds(rename=(id=groupuri name=groupname description=groupdesc))
|
||||||
|
out=&outds (keep=groupuri groupname groupdesc);
|
||||||
|
by groupname;
|
||||||
|
run;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%mend mx_getgroups;
|
%mend mx_getgroups;
|
||||||
Reference in New Issue
Block a user