%let dirLSB=/folders/myfolders/; data music; infile '&dirLSB.Bands.csv' DLM=',' dsd missover termstr=CRLF; length Band_name$ 30 Gig_date$ 10; input Band_name$ Gig_date$ Eight_PM Nine_PM Ten_PM Eleven_PM; run; proc print data=music; run; data music2; proc import datafile="&dirLSB.Bands2.csv" out=music2 replace; run; proc compare base=music compare=music2; title 'music vs music2'; run;
Hello everyone,
I have included my output as attached. Any hint or correction is appreciated!
data music; infile '/folders/myfolders/Bands.csv' DLM=',' dsd missover; length Band_name$ 30 Gig_date$ 10; input Band_name$ Gig_date$ Eight_PM Nine_PM Ten_PM Eleven_PM; run; data music2; proc import datafile="&dirLSB.Bands2.csv" out=music2 replace; run; proc compare base=music compare=music2; title 'music vs music2'; run;
I used this instead and it worked. Thanks:)
Much more interesting than the output would be the infile to run the code against.
data music; infile '/folders/myfolders/Bands.csv' DLM=',' dsd missover; length Band_name$ 30 Gig_date$ 10; input Band_name$ Gig_date$ Eight_PM Nine_PM Ten_PM Eleven_PM; run; data music2; proc import datafile="&dirLSB.Bands2.csv" out=music2 replace; run; proc compare base=music compare=music2; title 'music vs music2'; run;
I used this instead and it worked. Thanks:)
Your code wouldn't run properly so your log should have errors.
See my comments below:
%let dirLSB=/folders/myfolders/; data music; infile '&dirLSB.Bands.csv' DLM=',' dsd missover termstr=CRLF; %* needs double not single quotes. Macro variables do not resolve in single quotes so the file would not be read; length Band_name$ 30 Gig_date$ 10; input Band_name$ Gig_date$ Eight_PM Nine_PM Ten_PM Eleven_PM; run; proc print data=music; run; data music2; *This line does nothing and shouldn't be here. Delete it; proc import datafile="&dirLSB.Bands2.csv" out=music2 replace; %* this is missing DBMS=CSV; run; proc compare base=music compare=music2; title 'music vs music2'; run;
@jc3992 wrote:
%let dirLSB=/folders/myfolders/; data music; infile '&dirLSB.Bands.csv' DLM=',' dsd missover termstr=CRLF; length Band_name$ 30 Gig_date$ 10; input Band_name$ Gig_date$ Eight_PM Nine_PM Ten_PM Eleven_PM; run; proc print data=music; run; data music2; proc import datafile="&dirLSB.Bands2.csv" out=music2 replace; run; proc compare base=music compare=music2; title 'music vs music2'; run;Hello everyone,
I have included my output as attached. Any hint or correction is appreciated!
Thank you very much!! It works! thanks!
@jc3992 wrote:
%let dirLSB=/folders/myfolders/; data music; infile '&dirLSB.Bands.csv' DLM=',' dsd missover termstr=CRLF; length Band_name$ 30 Gig_date$ 10; input Band_name$ Gig_date$ Eight_PM Nine_PM Ten_PM Eleven_PM; run; proc print data=music; run; data music2; proc import datafile="&dirLSB.Bands2.csv" out=music2 replace; run; proc compare base=music compare=music2; title 'music vs music2'; run;Hello everyone,
I have included my output as attached. Any hint or correction is appreciated!
data music would not be created properly (no records) because the single quotes in the infile statement keep the macro variable from resolving.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.