1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-03 15:40:05 +00:00

fix: switching MAX for LENGTH to get max label value. Closes #300

This commit is contained in:
Allan Bowe
2022-08-17 20:54:14 +00:00
parent aabbcfdf6b
commit a2df4e35be
5 changed files with 34 additions and 34 deletions

View File

@@ -62,7 +62,7 @@
@param [in] maxobs= (MAX) Provide an integer to limit the number of input rows
that should be converted to JSON
<h4> Related Macros </h4>
<h4> Related Files </h4>
@li mp_ds2fmtds.sas
@version 9.2
@@ -210,7 +210,7 @@
order by 1;
create table &tmpds2(
FMTNAME char(32),
MAX num length=3
LENGTH num
);
%local catlist cat fmtlist i;
select distinct fmtcat into: catlist separated by ' ' from &tmpds1;
@@ -219,16 +219,16 @@
proc sql;
select distinct fmtname into: fmtlist separated by ' '
from &tmpds1 where fmtcat="&cat";
proc format lib=&cat cntlout=&tmpds3(keep=fmtname max);
proc format lib=&cat cntlout=&tmpds3(keep=fmtname length);
select &fmtlist;
run;
proc sql;
insert into &tmpds2 select distinct fmtname,max from &tmpds3;
insert into &tmpds2 select distinct fmtname,length from &tmpds3;
%end;
proc sql;
create table &tmpds4 as
select a.*, b.max as maxw
select a.*, b.length as maxw
from &colinfo a
left join &tmpds2 b
on cats(a.format)=cats(upcase(b.fmtname))