- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
"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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
"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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ksarp,
Thanks for one more variant , I'll look also into it.