Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. SPhill

    Reading in unusual var names from csv

    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
  2. SPhill

    Reading in unusual var names from csv

    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"...
  3. SPhill

    Proc Import giving "VAR1-VARn"

    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
  4. SPhill

    Proc Import giving "VAR1-VARn"

    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
  5. SPhill

    Proc Import giving "VAR1-VARn"

    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)...
  6. SPhill

    Proc Import giving "VAR1-VARn"

    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...
  7. SPhill

    Assign filename in Proc Import

    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...
  8. SPhill

    Assign filename in Proc Import

    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...
  9. SPhill

    Assign filename in Proc Import

    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...
  10. SPhill

    SAS and concatenated mixed data.

    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
  11. SPhill

    SAS and concatenated mixed data.

    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...
  12. SPhill

    Tricky array problem

    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...
  13. SPhill

    SAS and sum

    Thanks guys, this has helped a lot. SP
  14. SPhill

    SAS and sum

    Thanks Klaz, this works:- Proc SQL; create table sumstats as select polref,inrref,covref,funds,sum(unitts) as Total from mytable group by...
  15. SPhill

    SAS and sum

    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...
  16. SPhill

    Arrays

    I've got quite a few variables, the array holds units and fund values for 50 versions, not to mention key variables. I've quickly tested your second suggestion and it seems to work fine, thanks very much. SP
  17. SPhill

    Arrays

    Hello, I have some data in held in an array which I've managed to extract and it looks like this:- Obs inrref covref f1 f2 f3 unitt1 unitt2 unitt3 1 1 1 628 . . 725 0 0 2 2 1 . 629 . 0 565 0 3 3 1 . . 312 0 0 18...
  18. SPhill

    SAS and RETAIN

    Hello, I've been using retain to create a rolling summary of unit1 (see units1), what I need to do now is stop this rolling summary so I can use 'IF.LAST.covref' to give me lines I'm after i.e. obs8 obs16 obs23 obs30 (there are other variables but I can't fit them in here) to give me the sum of...
  19. SPhill

    Blank Lines

    Thanks for this, I'll give it a go. Scott
  20. SPhill

    Blank Lines

    Anyone know how to eliminate the top two blank rows that ODS CSV creates? Thanks Scott(SAS8.2 TSO JCL MVS) My code below:- ods CSV body=CSV style=minimal rs=none; *; proc print; run; ods CSV close;

Part and Inventory Search

Back
Top