Hi All,
I have the task - compare more-less big xml files(~200 kb-1 mb).
This files is formed by proc metadata, so all text stored in one line, that isn't very good becouse SAS can read 32767 characters from one line.
As result I'd like to have a fact:
if files absolutely the same or have some differents.
Off cource I can compare file size but obviously equal file size doesn't garanty that content of files are same...
May be there are some cool:) procedure or smart soulution that allow solve the task?
Thanks!
"becouse SAS can read 32767 characters from one line."
Nor really. SAS can read more than 1G characters from one line. MikeZeba has already show it before at this forum.
About your question.
Did you consider using LIBNAME + XML to compare these xml files OR
you can directly use DATA STEP to compare them.
Ksharp
"becouse SAS can read 32767 characters from one line."
Nor really. SAS can read more than 1G characters from one line. MikeZeba has already show it before at this forum.
About your question.
Did you consider using LIBNAME + XML to compare these xml files OR
you can directly use DATA STEP to compare them.
Ksharp
Hi Ksharp,
Approach Libname +XML isn't ok in my case becouse this one-row xml file is actually formed by proc metadata and I already use libname XML + different xmlmaps for extracting neeeded info from this source xml file(formed by proc metadata).
But your first advise(about solution provided by MikeZdeb:lrecl>32767+ dsd and pad options) were perfect, actually what I need.
May be someone will be interested in the Mike code:
data new;
infile 'z:\names.txt' dsd lrecl=50000 pad;
input name : $15. @@;
run;
Thanks!
Hi. Or you can change the format of record, that also can settle this problem.
data new;
infile 'z:\names.txt' dsd recfm=n;
input name : $15. @@;
run;
Ksharp
Hi Ksarp,
Thanks for one more variant , I'll look also into it.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.