%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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.