Thanks for the reply, I've managed to fix this by using:
options validvarname=any ;
proc datasets library=work;
modify &&fname&i;
rename _ = '!'n ;
run;
I've got quite a few csv files with different headers so didn't fancy lots of proc imports.
Thanks
SP
Hello, I've got a problem with an input file which I've been asked to strip out some policy numbers. The problem arises with the first variable being called '!' i.e.
!,polref
*,1
*,2
*,3
*,4
*,5
PROC IMPORT OUT= WORK.exclam
DATAFILE= "C:\Scott\PeskyExclamation.csv"...
Thanks for the interest CW, do you mean 'getnames' and 'datarow', I tried them, didn't give us the result we were looking for as in my post '11 Sep 07 11:53' at the top. Are there any other options available within proc import?
SP
Great Klaz this works fine, should be a solution to our needs, had to put a couple of 'LRECL=3000' comments at the end of my filenames to make sure I'm getting all the columns but it works a treat.
Thanks very much.
SP
Thanks for the quick reply, I'm afraid I can't use INFILE as there's too many VARS and multiple CSV files with different column headers to set up a generic programme to cover them all. Basically the CSV files I've been given aren't any good they've specifically been setup for another (tedious)...
Hello, I've been given a few CSV type files I need to read into SAS, normally I'd use Proc Import and have no problems however there's some extra lines in these CSV type files which seem to baffle proc import.
Here's an example:-
blah blah blah blah blah
blah_blah, blah
blah, blah...
Yep nearly there thanks, I had found this 'http://support.sas.com/ctx/samples/index.jsp?sid=157&tab=code' which I've tried, it pretty much works, only problem I have now is I'm only pushing out the final .rpt file in my directory, it reads the other ones in but doesn't seem to hold them out in...
Thanks for the swift response and that's useful stuff, but what I have are a list of .csv type files (for our purposes they are called.rpt) which I need to read in and for every .rpt file I need to assign a variable called 'projclas'. Projclas has to match the .rpt filename it's reading in as in...
Is there any way to assign your file name in proc import, it's easily done in an extra data step but I'd like to avoid the extra datastep if I can? Needless to say I'll have multiple file to import and assign individual names for var 'projclass' in this example.
Thanks
SP
:-
proc import...
Yep, I've had to do this, we've got about 16 different formats all concatenated together so I've set up 16 different import procedures in a macro which works o/k, bit of a pain tho.
Anyway thanks for the reply.
SP
I’ve got a problem, we’ve got a large number of datasets
with different variables in different places which have
been concatenated into one large dataset, what I need to
do is read it all into a datastep and do a proc
summary/tabulate etc. Normally I’d use something like this
for reading in csv...
Hello, in my base table below I'm trying to create a rolling summary for unitt(i), by polref innref covref fund(i) The base array data is 'table 1' my output is 'table 2'. However with my code below I lose my rolling summary for fund2 due to it being set at fund1 on line 71 which gives obs 5 a...
I'm trying to do something which should be simple but am having problems with, basically using the underneath table I need to sum my 'unitts' field so it will give me a sum by polref inrref covref funds so obs 5 will show '249.57'.
PROC MEANS, PROC PRINT, with by statements work but I need the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.