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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by nickdel

  1. nickdel

    Number set to Target Value

    Hi, thanks for the response. You're correct, this is a very complex task and I actually found this article which describes the problem a lot better. Sadly it also highlights the unlikelihood of me achieving this! http://en.wikipedia.org/wiki/Knapsack_problem Thanks anyway, Nick where would...
  2. nickdel

    Number set to Target Value

    I have a very large dataset from which I need to create a subset of customers where their balance equals a target value... So for example, giving the following dataset: Customer 1 - 30 Customer 2 - 100 Customer 3 - 50 Customer 4 - 20 Customer 5 - 50 If I set my target value to 120, then I...
  3. nickdel

    Decimal Rounding

    Having a problem rounding a number to the tenth decimal place. Using SAS V8. data Inputs; input NoIn $50.; datalines; 325256.95299286436284664885258 ; run; data Rounded; set Inputs; format NoOut 32.10; NoOut = round(NoIn,.0000000001); run; Would expect to see a return of...
  4. nickdel

    Remote Libraries

    Nevermind, got this one working using SQL passthrough: proc sql; connect to odbc(dsn=sqlsrv user=user pwd=pwd); create table new as select * from connection to odbc (select * from ReallyReallyReallyReallyReallyLongTableName); quit; Nick where would we be without...
  5. nickdel

    How to use LAG or Retain function in Array

    123sush, you could use proc transpose to reshape your dataset and then from there it will be much easier to do your calculation. i.e. data Inputs; input @1 DrugName $6. @8 Year $4. @13 Price 2.; datalines; Drug A 2005 10 Drug B 2005 5 Drug C 2005 4 Drug A 2006 12 Drug B 2006 6 Drug C...
  6. nickdel

    Remote Libraries

    Hi, using SAS version 8. If I set up a remote library to a SQL Server, any tables on that SQL server with names longer than 32 characters do not show in the library. Is there a setting somewhere to just have SAS truncate the name so it is visible? Cheers Nick where would we be without...
  7. nickdel

    Assign value from macro variable

    Guys, sorry been away for a while! Thanks for the explaination, I think I have been treating SAS macro's incorrectly, shame they dont act like a function, would be extremely useful! Thanks again Nick where would we be without rhetorical questions...
  8. nickdel

    Assign value from macro variable

    Chris, using your code appears to invoke the macro but it then error's within the macro itself. However if I just call the macro outside of a datastep it works fine! macro: %macro FindUltimateParent(ChildOID); %let ParentID = &ChildOID; proc sql noprint; select Primary_LE_ID into: NextID...
  9. nickdel

    Assign value from macro variable

    I've created a macro which returns a single value. how do I implement it within a datastep so as to create a new variable within that datastep. i.e. data AppendParent; set MyInputs; format UltimateParent 11.; UltimateParent = FindUltimateParent(ChildEntity); run; So basically I want my...
  10. nickdel

    parse system command data

    ok, I actually figured this out but now hoping some macro guru can now help me out...! filename Results pipe 'command/c find /c /i "incremental" "x:\core sas\data\*.sas"'; data Results ; infile Results length=recLen; input buffer $varying256. reclen; OccurancesInFile =...
  11. nickdel

    parse system command data

    Not sure if this is possible but can I parse the results of the following into a dataset? x 'find /c "searchstr" "x:\sas\data\*.sas"'; basically all this does is call the DOS "find" command. The idea of the program is that it will search sas program files for a particular word or phrase...
  12. nickdel

    SAS V9 upgrade

    Thanks Chris, I've done quite a bit of research on this now so here's the details for anyone else in a similar situation! SAS Metadata server is free with the SAS 9 upgrade. This can then be used in conjuction with Management COnsole (also free) should you wish. You can continue to remote...
  13. nickdel

    SAS V9 upgrade

    Has anyone been involved in a SAS server upgrade. SAS are telling us that the Metadata server is fundamental to the operation of SAS 9. I can't help think that this is just SAS trying to squeeze yet more money out of us. Can anyone shed any light on this? where would we be without rhetorical...
  14. nickdel

    Count each null in a table

    hoinz, basically your last statement is what I am looking for. The total number of nulls throughout the whole table. The table has about 200 columns so I thought some sort of loop but I'm not really that great with PL/SQL as I've only used SQL server before. where would we be without rhetorical...
  15. nickdel

    Count each null in a table

    Is it possible to count every NULL in a table? I have a large table and users are asking how well it's populated. Thanks nick where would we be without rhetorical questions...

Part and Inventory Search

Back
Top