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!

Search results for query: *

  1. teralearner

    Need to find a maximum or minimum value?

    select case when col1 > col2 then col1 else col2 end as max1, case when col3 > max1 then col3 else max1 end as max_col if you have 4 colums, you need to get max1(result from col1 and col2) and max2 (result form col3 and col4). Get max_col from max1 and max2.
  2. teralearner

    Volatile Table Error in SAS

    I am not sure why you need to go through volatile table. You can create a SAS table from teradata table without going through volatile table. proc sql; Connect to teradata (user='c-sophie' password=XXXXXXXX); create table YOURsasTable as select * from connection to teradata (select YOURcolumns...
  3. teralearner

    access SAS from Queryman

    You can use volatile table. Create a table in your permanent space first, then create a volatile table and insert data from your permanent table. Drop your permanent table. Repeat the steps as many times as needed in a SAS macro loop. Remember you need to do all of the above in one teradata...
  4. teralearner

    access SAS from Queryman

    Instead of trying to access SAS dataset from Quaryman, you can use SAS teradata engine to create a Teradata table from your SAS dataset in you own permanent space (make use to use proper index to evenly distribute your rows among all AMPs) and join that table with other Tearadata tables.
  5. teralearner

    Use SAS Macro to build SQL params for Proc SQL

    All you need to check is if querystr is blank. You can start checking that when you check claimant. You also need this at the end to make sure these is at least one condition in querystr or .....
  6. teralearner

    I am trying to run a macro that has

    I have tested it before I posted. Could you post your log so I know what you are talking about.
  7. teralearner

    I am trying to run a macro that has

    Well, You need to change a bit more. From: %IF &ST=OR OR &ST=VA %THEN %DO; DATA WORK.Reg1_&ST.; SET WORK.MASTER; RUN; %END; To: %IF &ST=%str(OR) OR &ST=VA %THEN %DO; DATA WORK.Reg1_%trim(&ST); SET WORK.MASTER; RUN; %END;
  8. teralearner

    I am trying to run a macro that has

    Change %IF &ST=OR OR &ST=VA %THEN %DO; to %IF &ST=%STR(OR) OR &ST=VA %THEN %DO;
  9. teralearner

    from SAS to Access.

    Have you tried DDE? Here is a link on DDE and Access: http://ftp.sas.com/techsup/download/sample/datastep/msaccess.html The example is reading from Access, but it can be easily reversed.
  10. teralearner

    Calculate 'working days'

    See if this is what you want: data testdata; input startdate date9. @11 enddate date9.; format startdate enddate date9.; datalines; 08jan2003 02feb2003 17jan2003 31aug2003 05dec2002 27mar2003 ; data workingdays; set testdata; days = enddate - startdate; do i = 1 to days; if...
  11. teralearner

    Transpose of an matrix/array in SAS

    data new; set old(keep = a b) old(keep = b c) old (keep = e f); run;
  12. teralearner

    How to select invalid date

    data good bad; input REGD; if input(put(regd, z8.), ?? yymmdd8.) = . then output bad; else output good; datalines; 20021231 20001313 20000132 ;
  13. teralearner

    How to select invalid date

    1. REGD is not a SAS date field nor is a character. It is numerical field. 2. The INPUT function enables you to read the value of source by using a specified informat. The informat determines whether the result is numeric or character. Use INPUT to convert character values to numeric values...
  14. teralearner

    Invalid data filter

    Michael, Compress function removes specific characters from a character string and keep the rest. If there is nothing left, it is good record. Otherwise it is bad. That is why you can not use not compress. There is no need for all the informats and formats in your data step...
  15. teralearner

    Invalid data filter

    Your file is from another operating system. Those little boxes are spaces or tabs from another system. Try this: data _null_; infile 'c:\temp\structures.txt' delimiter='09'x MISSOVER DSD lrecl=32767 firstobs=2 ; informat CLIENT_NAME $10. ; informat SEGMENT $54. ; informat...
  16. teralearner

    Invalid data filter

    The VERIFY function returns the position of the first character in source that is not present in any excerpt. If VERIFY finds every character in source in at least one excerpt, it returns a 0. It looks like function Verify only works for letters. Try compress instead of verify. BTW, You do...
  17. teralearner

    Invalid data filter

    Do this: data tst; infile "c:\temp\structures.txt"; file "c:\temp\good_structures.txt"; input; found = compress(upcase(_infile_),'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.'); if found = '' then put _infile_; run; Check variable "found" to see wether you included...
  18. teralearner

    Invalid data filter

    _infile_ is your data in its origial format. You need you add delimiter in the good character list. Please give details on what does not work.
  19. teralearner

    Invalid data filter

    Again untested: data _null_; infile "your input file"; file "your output good file"; input; if verify(upcase(_infile_),'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.') then put _infile_; run; Same thing for bad file, just add a NOT in front of verify. You have to add delimiter...
  20. teralearner

    Invalid data filter

    Michael, Here is an untested code: data good bad; set WORK.structures2; if compress(upcase(FALIST),'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.') = '' then output good; else output bad; run; I saw your question on SAS-L. If you read from an...

Part and Inventory Search

Back
Top