Dear Everyone,
I am importing text file to SAS format. I want to use first row as name and start the data from third row. I am using the following code. It is not happening:
proc import datafile='H:\Seminar Class\Banking Seminar\Data by me\Bank Call Report\FFIEC data\FFIEC CDR Call Bulk All Schedules 03312011/FFIEC CDR Call Bulk POR 03312011.txt'
out=POR0311 dbms=dlm replace;
datarow=2; delimiter='09'x;
run;
If you want to read the data starting in row 3 then instruct SAS to do so by setting datarow=3
proc import datafile='c:\temp\test.txt'
out=POR0311
dbms=dlm replace;
datarow=3
;
delimiter='09'x;
getnames=yes;
guessingrows=max;
run;
If Proc Import can't fully do what you need then you can also always copy/paste the generated data step from the log into a code window and then amend this data step as you need it. This gives you full flexibility.
Post the log. Anytime something "does not work", post the log. Use the {i} button to preserve formatting.
it says 'datarow=2', but you want to start at row 3. Usually it is not recommended to modify the data source but why not just remove the 2nd row from the txt file and run the code again?
If you want to read the data starting in row 3 then instruct SAS to do so by setting datarow=3
proc import datafile='c:\temp\test.txt'
out=POR0311
dbms=dlm replace;
datarow=3
;
delimiter='09'x;
getnames=yes;
guessingrows=max;
run;
If Proc Import can't fully do what you need then you can also always copy/paste the generated data step from the log into a code window and then amend this data step as you need it. This gives you full flexibility.
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.