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