When the MATCH method in a DS2 PCRXFIND package is passed a long value, the following errors occur:
The Full Code tab contains a sample program that causes the errors.
In the sample program, the value of &Formula2 is 3,685 characters in length, and this macro variable causes the errors. However, a longer length value in &Formula3 runs to completion without errors because it consists of shorter pattern groups.
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | Base SAS | Microsoft Windows Server 2019 | 9.4 TS1M7 | |
Windows 7 Enterprise 32 bit | 9.4 TS1M7 | |||
Windows 7 Enterprise x64 | 9.4 TS1M7 | |||
Windows 7 Home Premium 32 bit | 9.4 TS1M7 | |||
Windows 7 Home Premium x64 | 9.4 TS1M7 | |||
Windows 7 Professional 32 bit | 9.4 TS1M7 | |||
Windows 7 Professional x64 | 9.4 TS1M7 | |||
Windows 7 Ultimate 32 bit | 9.4 TS1M7 | |||
Windows 7 Ultimate x64 | 9.4 TS1M7 | |||
64-bit Enabled AIX | 9.4 TS1M7 | |||
Microsoft Windows Server 2012 R2 Std | 9.4 TS1M7 | |||
Microsoft Windows Server 2012 Std | 9.4 TS1M7 | |||
Microsoft Windows Server 2016 | 9.4 TS1M7 | |||
Microsoft Windows Server 2012 R2 Datacenter | 9.4 TS1M7 | |||
Microsoft Windows Server 2012 Datacenter | 9.4 TS1M7 | |||
Microsoft Windows Server 2008 for x64 | 9.4 TS1M7 | |||
Microsoft Windows Server 2008 R2 | 9.4 TS1M7 | |||
z/OS | 9.4 TS1M7 | |||
z/OS 64-bit | 9.4 TS1M7 | |||
Microsoft® Windows® for x64 | 9.4 TS1M7 | |||
Microsoft Windows 8 Enterprise 32-bit | 9.4 TS1M7 | |||
Microsoft Windows 8 Enterprise x64 | 9.4 TS1M7 | |||
Microsoft Windows 8 Pro 32-bit | 9.4 TS1M7 | |||
Microsoft Windows 8 Pro x64 | 9.4 TS1M7 | |||
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 TS1M7 | |||
Microsoft Windows 8.1 Enterprise x64 | 9.4 TS1M7 | |||
Microsoft Windows 8.1 Pro 32-bit | 9.4 TS1M7 | |||
Microsoft Windows 8.1 Pro x64 | 9.4 TS1M7 | |||
Microsoft Windows 10 | 9.4 TS1M7 | |||
Microsoft Windows Server 2008 | 9.4 TS1M7 | |||
64-bit Enabled Solaris | 9.4 TS1M7 | |||
HP-UX IPF | 9.4 TS1M7 | |||
Linux for x64 | 9.4 TS1M7 | |||
Solaris for x64 | 9.4 TS1M7 |
/* formula1 has 3,670 characters */
%let formula1=
SUM(MFPR01002560,MFPR01002629,MFPR01002698,MFPR01002767,MFPR01002869,MFPR01003276,MFPR01003542,MFPR01003277,MFPR01003543,MFPR01003080,MFPR01003350,
MFPR01002000,MFPR01002070,MFPR01002420,MFPR01002490,MFPR01004288,MFPR01004358,MFMSUP000003,-MFPR01000450,-MFPR01001002,-MFPR01000519,-MFPR01001071,
-MFPR01000588,-MFPR01001140,-MFPR01001554,-MFPR01001623,-MFPR01001839,-MFPR01001937,-MFPR01002000,-MFPR01002070,-MFPR01002280,-MFPR01002350,
-MFPR01004148,-MFPR01004218,-MFMSUP000034,MFPR01002561,MFPR01002630,MFPR01002699,MFPR01002768,MFPR01002870,MFPR01003279,MFPR01003545,MFPR01003280,
MFPR01003546,MFPR01003083,MFPR01003353,MFPR01002001,MFPR01002071,MFPR01002421,MFPR01002491, MFPR01004289,MFPR01004359,-MFPR01000451,-MFPR01001003,
-MFPR01000520,-MFPR01001072,-MFPR01000589,-MFPR01001141,-MFPR01001555,-MFPR01001627,-MFPR01001840,-MFPR01001938,-MFPR01002001,-MFPR01002071,
-MFPR01002281,-MFPR01002351,-MFPR01004149,-MFPR01004219,-MFMSUP000052,MFPR01002562,MFPR01002631,MFPR01002700,MFPR01002769,MFPR01002871,MFPR01002002,
MFPR01002072,MFPR01002422,MFPR01002492,MFPR01004290,MFPR01004360,-MFPR01000452,-MFPR01001004,-MFPR01000521,-MFPR01001073,-MFPR01000590,-MFPR01001142,
-MFPR01001582,-MFPR01001651,-MFPR01001841,-MFPR01001939,-MFPR01002002,-MFPR01002072,-MFPR01002282,-MFPR01002352,-MFPR01004150,-MFPR01004220,MFPR01002564,
MFPR01002633,MFPR01002702,MFPR01002771,MFPR01002873,MFPR01002004,MFPR01002074,MFPR01002424,MFPR01002494,MFPR01004292,MFPR01004362,-MFPR01000454,
-MFPR01001006,-MFPR01000523,-MFPR01001075,-MFPR01000592,-MFPR01001144,-MFPR01001558,-MFPR01001627,-MFPR01001843,-MFPR01001941,-MFPR01002004,
-MFPR01002074,-MFPR01002284,-MFPR01002354,-MFPR01004152,-MFPR01004222,MFPR01002566,MFPR01002635,MFPR01002704,MFPR01002773,MFPR01002835,MFPR01002875,
MFPR01003090,MFPR01003158,MFPR01003217,MFPR01003285,MFPR01003360,MFPR01003428,MFPR01003485,MFPR01003551,MFPR01002146,MFPR01002216,MFPR01002426,
MFPR01002496,MFPR01004294,MFPR01004364,MFPR01002571,MFPR01002640,MFPR01002709,MFPR01002778,MFPR01002840,MFPR01002880,MFPR01003096,MFPR01003163,
MFPR01003223,MFPR01003291,MFPR01003366,MFPR01003433,MFPR01003491,MFPR01003557,MFPR01002152,MFPR01002222,MFPR01002432,MFPR01002502,MFPR01004300,
MFPR01004370,MFPR01004429,MFPR01004461,MFPR01002565,MFPR01002634,MFPR01002703,MFPR01002772,MFPR01002874,MFPR01003089,MFPR01003157,MFPR01003216,
MFPR01003284,MFPR01003359,MFPR01003427,MFPR01003484,MFPR01003550,MFPR01002145,MFPR01002215,MFPR01002425,MFPR01002495,MFPR01004293,MFPR01004363,
MFPR01002581,MFPR01002650,MFPR01002719,MFPR01002788,MFPR01002890,MFPR01002162,MFPR01002232,MFPR01002442,MFPR01002512,MFPR01004310,MFPR01004380,
MFPR01002582,MFPR01002651,MFPR01002720,MFPR01002789,MFPR01002891,MFPR01003106,MFPR01003173,MFPR01003233,MFPR01003301,MFPR01003376,MFPR01003443,
MFPR01003501,MFPR01003567,MFPR01002163,MFPR01002233,MFPR01002443,MFPR01002513,MFPR01004311,MFPR01004381,MFPR01002577,MFPR01002646,MFPR01002715,
MFPR01002784,MFPR01002886,MFPR01003102,MFPR01003169,MFPR01003229,MFPR01003297,MFPR01003372,MFPR01003439,MFPR01003497,MFPR01003563,MFPR01002158,
MFPR01002228,MFPR01002438,MFPR01002508,MFPR01004306,MFPR01004376,MFMSUP000031,-MFPR01000161,MFPR01000461,-MFPR01000737,MFPR01001565,MFPR01000456,
-MFPR01000732,MFPR01001560, MFPR01000455,-MFPR01000731,MFPR01001559,MFMSUP000056,MFPR01000471,-MFPR01000747,MFPR01001575,MFPR01000467,-MFPR01000743,
MFPR01001571,MFPR01000472,-MFPR01000748,MFPR01001576,MFPR01000530,-MFPR01000806,MFPR01000599,-MFPR01000875,MFPR01000668,MFPR01000525,-MFPR01000801,
MFPR01000594,-MFPR01000870,MFPR01000663,MFPR01000524,-MFPR01000800,MFPR01000593,-MFPR01000869,MFPR01000662,MFPR01000540,-MFPR01000816,MFPR01000541);
/* formula2 has 3,685 characters */
%let formula2=
SUM(MFPR01002560,MFPR01002629,MFPR01002698,MFPR01002767,MFPR01002869,MFPR01003276,MFPR01003542,MFPR01003277,MFPR01003543,MFPR01003080,MFPR01003350,
MFPR01002000,MFPR01002070,MFPR01002420,MFPR01002490,MFPR01004288,MFPR01004358,MFMSUP000003,-MFPR01000450,-MFPR01001002,-MFPR01000519,-MFPR01001071,
-MFPR01000588,-MFPR01001140,-MFPR01001554,-MFPR01001623,-MFPR01001839,-MFPR01001937,-MFPR01002000,-MFPR01002070,-MFPR01002280,-MFPR01002350,
-MFPR01004148,-MFPR01004218,-MFMSUP000034,MFPR01002561,MFPR01002630,MFPR01002699,MFPR01002768,MFPR01002870,MFPR01003279,MFPR01003545,MFPR01003280,
MFPR01003546,MFPR01003083,MFPR01003353,MFPR01002001,MFPR01002071,MFPR01002421,MFPR01002491, MFPR01004289,MFPR01004359,-MFPR01000451,-MFPR01001003,
-MFPR01000520,-MFPR01001072,-MFPR01000589,-MFPR01001141,-MFPR01001555,-MFPR01001627,-MFPR01001840,-MFPR01001938,-MFPR01002001,-MFPR01002071,
-MFPR01002281,-MFPR01002351,-MFPR01004149,-MFPR01004219,-MFMSUP000052,MFPR01002562,MFPR01002631,MFPR01002700,MFPR01002769,MFPR01002871,MFPR01002002,
MFPR01002072,MFPR01002422,MFPR01002492,MFPR01004290,MFPR01004360,-MFPR01000452,-MFPR01001004,-MFPR01000521,-MFPR01001073,-MFPR01000590,-MFPR01001142,
-MFPR01001582,-MFPR01001651,-MFPR01001841,-MFPR01001939,-MFPR01002002,-MFPR01002072,-MFPR01002282,-MFPR01002352,-MFPR01004150,-MFPR01004220,MFPR01002564,
MFPR01002633,MFPR01002702,MFPR01002771,MFPR01002873,MFPR01002004,MFPR01002074,MFPR01002424,MFPR01002494,MFPR01004292,MFPR01004362,-MFPR01000454,
-MFPR01001006,-MFPR01000523,-MFPR01001075,-MFPR01000592,-MFPR01001144,-MFPR01001558,-MFPR01001627,-MFPR01001843,-MFPR01001941,-MFPR01002004,
-MFPR01002074,-MFPR01002284,-MFPR01002354,-MFPR01004152,-MFPR01004222,MFPR01002566,MFPR01002635,MFPR01002704,MFPR01002773,MFPR01002835,MFPR01002875,
MFPR01003090,MFPR01003158,MFPR01003217,MFPR01003285,MFPR01003360,MFPR01003428,MFPR01003485,MFPR01003551,MFPR01002146,MFPR01002216,MFPR01002426,
MFPR01002496,MFPR01004294,MFPR01004364,MFPR01002571,MFPR01002640,MFPR01002709,MFPR01002778,MFPR01002840,MFPR01002880,MFPR01003096,MFPR01003163,
MFPR01003223,MFPR01003291,MFPR01003366,MFPR01003433,MFPR01003491,MFPR01003557,MFPR01002152,MFPR01002222,MFPR01002432,MFPR01002502,MFPR01004300,
MFPR01004370,MFPR01004429,MFPR01004461,MFPR01002565,MFPR01002634,MFPR01002703,MFPR01002772,MFPR01002874,MFPR01003089,MFPR01003157,MFPR01003216,
MFPR01003284,MFPR01003359,MFPR01003427,MFPR01003484,MFPR01003550,MFPR01002145,MFPR01002215,MFPR01002425,MFPR01002495,MFPR01004293,MFPR01004363,
MFPR01002581,MFPR01002650,MFPR01002719,MFPR01002788,MFPR01002890,MFPR01002162,MFPR01002232,MFPR01002442,MFPR01002512,MFPR01004310,MFPR01004380,
MFPR01002582,MFPR01002651,MFPR01002720,MFPR01002789,MFPR01002891,MFPR01003106,MFPR01003173,MFPR01003233,MFPR01003301,MFPR01003376,MFPR01003443,
MFPR01003501,MFPR01003567,MFPR01002163,MFPR01002233,MFPR01002443,MFPR01002513,MFPR01004311,MFPR01004381,MFPR01002577,MFPR01002646,MFPR01002715,
MFPR01002784,MFPR01002886,MFPR01003102,MFPR01003169,MFPR01003229,MFPR01003297,MFPR01003372,MFPR01003439,MFPR01003497,MFPR01003563,MFPR01002158,
MFPR01002228,MFPR01002438,MFPR01002508,MFPR01004306,MFPR01004376,MFMSUP000031,-MFPR01000161,MFPR01000461,-MFPR01000737,MFPR01001565,MFPR01000456,
-MFPR01000732,MFPR01001560, MFPR01000455,-MFPR01000731,MFPR01001559,MFMSUP000056,MFPR01000471,-MFPR01000747,MFPR01001575,MFPR01000467,-MFPR01000743,
MFPR01001571,MFPR01000472,-MFPR01000748,MFPR01001576,MFPR01000530,-MFPR01000806,MFPR01000599,-MFPR01000875,MFPR01000668,MFPR01000525,-MFPR01000801,
MFPR01000594,-MFPR01000870,MFPR01000663,MFPR01000524,-MFPR01000800,MFPR01000593,-MFPR01000869,MFPR01000662,MFPR01000540,-MFPR01000816,MFPR01000541,
MFPR01000536);
/* formula3 has 3,691 characters with two pattern groups */
%let formula3=
SUM(MFPR01002560,MFPR01002629,MFPR01002698,MFPR01002767,MFPR01002869,MFPR01003276,MFPR01003542,MFPR01003277,MFPR01003543,MFPR01003080,MFPR01003350,
MFPR01002000,MFPR01002070,MFPR01002420,MFPR01002490,MFPR01004288,MFPR01004358,MFMSUP000003,-MFPR01000450,-MFPR01001002,-MFPR01000519,-MFPR01001071,
-MFPR01000588,-MFPR01001140,-MFPR01001554,-MFPR01001623,-MFPR01001839,-MFPR01001937,-MFPR01002000,-MFPR01002070,-MFPR01002280,-MFPR01002350,
-MFPR01004148,-MFPR01004218,-MFMSUP000034,MFPR01002561,MFPR01002630,MFPR01002699,MFPR01002768,MFPR01002870,MFPR01003279,MFPR01003545,MFPR01003280,
MFPR01003546,MFPR01003083,MFPR01003353,MFPR01002001,MFPR01002071,MFPR01002421,MFPR01002491, MFPR01004289,MFPR01004359,-MFPR01000451,-MFPR01001003,
-MFPR01000520,-MFPR01001072,-MFPR01000589,-MFPR01001141,-MFPR01001555,-MFPR01001627,-MFPR01001840,-MFPR01001938,-MFPR01002001,-MFPR01002071,
-MFPR01002281,-MFPR01002351,-MFPR01004149,-MFPR01004219,-MFMSUP000052,MFPR01002562,MFPR01002631,MFPR01002700,MFPR01002769,MFPR01002871,MFPR01002002,
MFPR01002072,MFPR01002422,MFPR01002492,MFPR01004290,MFPR01004360,-MFPR01000452,-MFPR01001004,-MFPR01000521,-MFPR01001073,-MFPR01000590,-MFPR01001142,
-MFPR01001582,-MFPR01001651,-MFPR01001841,-MFPR01001939,-MFPR01002002,-MFPR01002072,-MFPR01002282,-MFPR01002352,-MFPR01004150,-MFPR01004220,MFPR01002564,
MFPR01002633,MFPR01002702,MFPR01002771,MFPR01002873,MFPR01002004,MFPR01002074,MFPR01002424,MFPR01002494,MFPR01004292,MFPR01004362,-MFPR01000454,
-MFPR01001006,-MFPR01000523,-MFPR01001075,-MFPR01000592,-MFPR01001144,-MFPR01001558,-MFPR01001627,-MFPR01001843,-MFPR01001941,-MFPR01002004) +
SUM(-MFPR01002074,-MFPR01002284,-MFPR01002354,-MFPR01004152,-MFPR01004222,MFPR01002566,MFPR01002635,MFPR01002704,MFPR01002773,MFPR01002835,MFPR01002875,
MFPR01003090,MFPR01003158,MFPR01003217,MFPR01003285,MFPR01003360,MFPR01003428,MFPR01003485,MFPR01003551,MFPR01002146,MFPR01002216,MFPR01002426,
MFPR01002496,MFPR01004294,MFPR01004364,MFPR01002571,MFPR01002640,MFPR01002709,MFPR01002778,MFPR01002840,MFPR01002880,MFPR01003096,MFPR01003163,
MFPR01003223,MFPR01003291,MFPR01003366,MFPR01003433,MFPR01003491,MFPR01003557,MFPR01002152,MFPR01002222,MFPR01002432,MFPR01002502,MFPR01004300,
MFPR01004370,MFPR01004429,MFPR01004461,MFPR01002565,MFPR01002634,MFPR01002703,MFPR01002772,MFPR01002874,MFPR01003089,MFPR01003157,MFPR01003216,
MFPR01003284,MFPR01003359,MFPR01003427,MFPR01003484,MFPR01003550,MFPR01002145,MFPR01002215,MFPR01002425,MFPR01002495,MFPR01004293,MFPR01004363,
MFPR01002581,MFPR01002650,MFPR01002719,MFPR01002788,MFPR01002890,MFPR01002162,MFPR01002232,MFPR01002442,MFPR01002512,MFPR01004310,MFPR01004380,
MFPR01002582,MFPR01002651,MFPR01002720,MFPR01002789,MFPR01002891,MFPR01003106,MFPR01003173,MFPR01003233,MFPR01003301,MFPR01003376,MFPR01003443,
MFPR01003501,MFPR01003567,MFPR01002163,MFPR01002233,MFPR01002443,MFPR01002513,MFPR01004311,MFPR01004381,MFPR01002577,MFPR01002646,MFPR01002715,
MFPR01002784,MFPR01002886,MFPR01003102,MFPR01003169,MFPR01003229,MFPR01003297,MFPR01003372,MFPR01003439,MFPR01003497,MFPR01003563,MFPR01002158,
MFPR01002228,MFPR01002438,MFPR01002508,MFPR01004306,MFPR01004376,MFMSUP000031,-MFPR01000161,MFPR01000461,-MFPR01000737,MFPR01001565,MFPR01000456,
-MFPR01000732,MFPR01001560, MFPR01000455,-MFPR01000731,MFPR01001559,MFMSUP000056,MFPR01000471,-MFPR01000747,MFPR01001575,MFPR01000467,-MFPR01000743,
MFPR01001571,MFPR01000472,-MFPR01000748,MFPR01001576,MFPR01000530,-MFPR01000806,MFPR01000599,-MFPR01000875,MFPR01000668,MFPR01000525,-MFPR01000801,
MFPR01000594,-MFPR01000870,MFPR01000663,MFPR01000524,-MFPR01000800,MFPR01000593,-MFPR01000869,MFPR01000662,MFPR01000540,-MFPR01000816,MFPR01000541,
MFPR01000536);
proc ds2;
data _null_;
method run();
dcl varchar(20) indicator;
dcl varchar(1000) re_indicator re_agg common_indicator_pattern tokens;
dcl varchar(100000) agg;
dcl package pcrxreplace rxr();
dcl package pcrxfind rxf();
dcl integer rc;
dcl varchar(1000000) formula;
/* perl regular expression patterns for indicators, aggregation functions, and nested aggregation functions */
tokens='(,|\*|\/|-|\*\*|\+|\(|\))';
common_indicator_pattern='(mf|en|ef)\w+(\[\w+\])?';
re_indicator=cats('((\b(log|abs\()',common_indicator_pattern,'\))|(\b',common_indicator_pattern,'))');
re_agg=cats('((sum)|(max)|(min)|(mean))\(-?',re_indicator,'(,-?',re_indicator,')*\)');
/* &formula1 can be matched without error */
/* formula=compress(%tslit(&formula1));*/
/* &formula2 causes the DS2 pcrxfind package errors - it has one very long group */
formula=compress(%tslit(&formula2));
/* &formula3 has an overall longer length but is composed of two shorter pattern groups and is successful */
/* formula=compress(%tslit(&formula3));*/
rxf.parse(cats('/',re_agg,'/i'));
rxf.match(formula);
rxf.getGroup(agg,0);
put agg=;
rxf.parse(cats('/',re_indicator,'/i'));
rxf.match(formula);
rxf.getGroup(indicator,0);
put indicator=;
end;
run;
quit;
A fix for this issue for SAS Threaded Kernel DS2 and FedSQL Language Processors 9.41_M5 is available at:
https://tshf.sas.com/techsup/download/hotfix/HF2/I9H.html#67219A fix for this issue for SAS Threaded Kernel 9.4_M7 is available at:
https://tshf.sas.com/techsup/download/hotfix/HF2/I5V.html#67219Type: | Problem Note |
Priority: | medium |
Topic: | SAS Reference ==> Procedures ==> DS2 |
Date Modified: | 2021-01-15 15:18:09 |
Date Created: | 2021-01-13 12:18:08 |