10-29-2013 03:45 PM
So i am pretty sure the language here is wrong, remember i am new to this, any kind help would be appreciated!
if I select a field from one of my tables/another field ex: (t1.NCOVD_CHRG_AMT/t1.TOT_CHRG)
i get error
2 OPTIONS PAGENO=MIN;
3 OPTION DEBUG=DBMS_SELECT SQL_IP_TRACE=(NOTE, SOURCE);
4 PROC SQL NOEXEC;
5 SELECT (t1.NCOVD_CHRG_AMT/t1.TOT_CHRG) AS CALCULATION
6 FROM TABLE1.MEDA_ADJUD_CLM_HDR t1, TABLE2.MEDA_ADJUD_CLM_RSN t2, TABLE3.MEDA_ADJUD_REVN_LN t3
ERROR 22-322: Syntax error, expecting one of the following: ',', GROUP, HAVING, ORDER, WHERE.
ERROR 76-322: Syntax error, statementw ill be ignored.
8 %PUT SQL IPTRACE_RESULT=&SYS_SQL_IP_ALL;
9 OPTIONS SQL_IP_TRACE=(NONE);
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
11 ! RUN;
????????? What would i need to use for the advanced expression to receive a percentage without an error
- PROC SQL NOEXEC;
SELECT (t1.NCOVD_CHRG_AMT/t1.TOT_CHRG) AS CALCULATION
FROM TABLE1.MEDA_ADJUD_CLM_HDR t1, TABLE2.MEDA_ADJUD_CLM_RSN t2, TABLE3.MEDA_ADJUD_REVN_LN t3
10-29-2013 04:36 PM
Are you using Query Builder or writing your own code?
You have 3 tables provided as source tables, are you actually looking for information from 3 tables or only 1?
If you were writing code it would be something like the following, assuming 1 table is the source.
PROC SQL ;
CREATE TABLE WANT AS
SELECT t1. *, (t1.NCOVD_CHRG_AMT/t1.TOT_CHRG) AS PCT_Change format=percent8.2
FROM TABLE1.MEDA_ADJUD_CLM_HDR t1;
10-31-2013 11:19 AM
I am using query builder, and I am using information from one table only, i want to calculate an error rate, noncovere/total charges.
gosh i feel dumb in here!
10-29-2013 04:52 PM
Are you pulling some data from tables t2 and t3?
If you don't, you need to remove them from FROM clause and add semicolon ( after t1 in FROM clause - i.e. at the end of SELECT statement.
If you do, you need to tell query how to connect them - add WHERE clause:
WHERE t1.some_field = t2.some_field
and t2.some_field = t3.some_field
10-31-2013 11:49 AM
The error being displayed is due to a missing semicolon after the select statement and before the quit statement. Suggest adding the ';' and reposting if you get a non-spurious error.
11-01-2013 11:00 AM
I was able to fix the problem, a coworker was available to assist, thank you for everyone's help!