Hi all,
So I have small task: divide string into few sub-strings, using Delimiter ="]}".
But there are few "]" and "}" in source string - scan function treat each of this chars as delimeter and return wrong result...
Example:
%macro divideIntoSepareteJsons;
%let str1="typ}es": ]} "LAYO]UT":]} "Label": "LAYOUT";
%let str2=%bquote(&str1);
%let delim=%bquote(]});
data test;
txt="&str2";
del="&delim";
firstword=scan(txt,1,del);
secword=scan(txt,2,del);
thirdword=scan(txt,3,del);
forword=scan(txt,4,del);
;
run;
%mend;
%divideIntoSepareteJsons
So results must be:
firstword="typ}es":;
secword="LAYO]UT":
thirdword="Label": "LAYOUT"
forword=
But , becouse we have "}" in first sub-string("typ}es":) we have such result:
firstword="typ
secword=es":;
thirdword="LAYO]UT":
forword="Label": "LAYOUT"
So I must somehow said SAS that I look only for whole "]}" as delimiter, not for 2 separate delimiters...
Thanks in advanced for your help...