Seeking assistance on why errors on generating on below program.
1 The SAS System 14:42 Wednesday, September 11, 2019
1 ;*';*";*/;quit;run;
2 OPTIONS PAGENO=MIN;
3 %LET _CLIENTTASKLABEL='Program (2)';
4 %LET _CLIENTPROCESSFLOWNAME='Process Flow';
5 %LET _CLIENTPROJECTPATH='C:\Users\PSTENNIS\Documents\ALL\ADHOC REQUEST\TINA LOCH\CLAIMS_PULL_PROC_SCHEDULES.egp';
6 %LET _CLIENTPROJECTNAME='CLAIMS_PULL_PROC_SCHEDULES.egp';
7 %LET _SASPROGRAMFILE=;
8
9 ODS _ALL_ CLOSE;
10 OPTIONS DEV=ACTIVEX;
11 GOPTIONS XPIXELS=0 YPIXELS=0;
12 FILENAME EGSR TEMP;
13 ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR
14 STYLE=HtmlBlue
15 STYLESHEET=(URL="file:///C:/Program%20Files%20(x86)/SAS%20EG%209.4.1/x86/SASEnterpriseGuide/7.1/Styles/HtmlBlue.css")
16 NOGTITLE
17 NOGFOOTNOTE
18 GPATH=&sasworklocation
19 ENCODING=UTF8
20 options(rolap="on")
21 ;
NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
22
23 GOPTIONS ACCESSIBLE;
24
25 option obs=max;
26
27 proc sql noprint /*INOBS=100*/;
28 create table claims as
29 Select * FROM
30 (Select Distinct
31 CH.CLAIM_NUMBER as ClaimID
32 ,CH.PAT_CONTROL_NO as PCN
33 , CD.LINE_NUMBER as ClaimLine
34 , CD.SUB_LINE_CODE as LineCode
35 , CD.RESERVED_LOCAL_USE_DET AS WCN
36 , CD.DETAIL_SVC_DATE as FromDate
37 , . as ThruDate
38 , CD.PROCEDURE_CODE as CPT
39 , ' ' as AltCPT
40 , CH.PLAN_CODE as PlanCode
41 , CD.HCPCS_MODIFIER_1 as ModCode
42 , CD.HCPCS_MODIFIER_2 as ModCode2
43 , CD.HCPCS_MODIFIER_3 as ModCode3
44 , CH.DIAGNOSIS_1 as Diag1
45 , CH.DIAGNOSIS_2 as Diag2
46 , CH.DIAGNOSIS_3 as Diag3
47 , ' ' as BillClass
48 , ' ' as PatientStatus
49 , CH.PLACE_OF_SERVICE_1 as Location
50 , CH.TOTAL_BILLED_AMT as HeaderBilledAmount
51 , CH.TOTAL_NET_AMT as TotalNetAmount
52 , CH.DATE_RECEIVED
53 , CH.INSERT_DATETIME
54 , CD.BILLED_AMT as LineBilledAmount
55 , CD.PRICE_SCHEDULE as PriceScheduleAmount
56 , CD.NET_AMT as ClaimLinePaidAmount
57 , CD.PAID_NET_AMT as ClaimLineAmtPaidwithInt
2 The SAS System 14:42 Wednesday, September 11, 2019
58 , CD.CLAIM_STATUS as ClaimStatus
59 , CD.PROCESSING_STATUS as ProcessingStatus
60 , CD.POST_DATE as PostDate
61 , CD.CHECK_DATE as CheckDate
62 , CD.ALLOWED_AMT as AllowedAmount
63 , CD.QUANTITY as Quantity
64 , CD.NOT_COVERED_AMT as NotcoveredAmount
65 , CD.NOT_COV_QTY as NotCoveredQuantity
66 , CD.NDC_CODE
67 , MM.SEQ_MEMB_ID as MemberID
68 , MM.LAST_NAME as MemberLastName
69 , MM.FIRST_NAME as MemberFirstName
70 , MM.DATE_OF_BIRTH as MemberDOB
71 , MM.GENDER as M_F
72 , MM.MEDICAID_NO as MedicaidID
73 , PM.SEQ_PROV_ID as ProviderID
74 , PM.LAST_NAME as PROVIDERLASTNAME
75 , PM.FIRST_NAME as PROVIDERFIRSTNAME
76 , CH.PROVIDER_NPI as NATIONAL_PROVIDER_ID
77 , CH.PROVIDER_PAR_STAT as ParStatus
78 , CH.PROVIDER_TYPE as ProviderType
79 , CH.PROVIDER_SPEC as ProviderSpecialty
80 , CH.PROVIDER_PCP_FLAG as PCPFlag
81 , VM.SEQ_VEND_ID as VendorID
82 , VM.IRS_TAX_ID as VendorTaxID
83 , VM.FULL_NAME as VendorFullName
84 , CD.ALLOWED_REASON as AllowedReason
85 , CD.NOT_COVERED_REASON as NotCoveredReason
86 , CD.HOLD_REASON_1
87 , CD.HOLD_REASON_2
88 , CD.HOLD_REASON_3
89 , CH.AUTH_NUMBER
90 , CH.AUTH_TYPE
91 , CH.LINE_OF_BUSINESS as LOB
92 , 'P' as ClaimType
93 FROM
94 HSDREPT.PROFSVC_CLAIM_HEADER CH,
95 HSDREPT.PROFSVC_CLAIM_DETAIL CD,
96 HSDREPT.PROV_MASTER PM,
97 HSDREPT.MEMBER_MASTER MM,
98 HSDREPT.VENDOR_MASTER VM
99 WHERE
100 CH.SEQ_CLAIM_ID = CD.SEQ_CLAIM_ID
101 AND CH.SEQ_MEMB_ID = MM.SEQ_MEMB_ID
102 AND CH.SEQ_PROV_ID = PM.SEQ_PROV_ID
103 AND CH.SEQ_VEND_ID = VM.SEQ_VEND_ID
104 AND CD.POST_DATE >= '1JUL2019:0:0:0'dt
105 AND CH.LINE_OF_BUSINESS = 'NED'
106 /*and &beg <= datepart(CD.POST_DATE) <= &end*/
107
108 UNION ALL
109 SELECT DISTINCT
110 CH.CLAIM_NUMBER as ClaimID
111 , CH.PATIENT_CONTROL_NO as PCN
112 , CD.LINE_NUMBER as ClaimLine
113 , CD.SUB_LINE_CODE as LineCode
114 , CH.STATE_UNLABELED_3 AS WCN
115 , CD.DETAIL_SVC_DATE as FROMDATE
3 The SAS System 14:42 Wednesday, September 11, 2019
116 , CD.DETAIL_THRU_DATE as THRUDATE
117 , CD.PROCEDURE_CODE as CPT
118 , CD.ALTERNATE_PROC_CODE as AltCPT
119 , CH.PLAN_CODE as PlanCode
120 , CD.PROCEDURE_MODIFIER as ModCode
121 , CD.PROCEDURE_MODIFIER_2 as ModCode2
122 , CD.PROCEDURE_MODIFIER_3 as ModCode3
123 , CH.DIAGNOSIS_1 as Diag1
124 , CH.DIAGNOSIS_2 as Diag2
125 , CH.DIAGNOSIS_3 as Diag3
126 , CH.BILL_TYPE as BillClass
127 , CH.PATIENT_STATUS as PatientStatus
128 , CH.PLACE_OF_SERVICE_1 as Location
129 , CH.TOTAL_BILLED_AMT as HeaderBilledAmount
130 , CH.TOTAL_NET_AMT as TotalNetAmount
131 , CH.DATE_RECEIVED
132 , CH.INSERT_DATETIME
133 , CD.BILLED_AMT as LineBilledAmount
134 , CD.PRICE_SCHEDULE as PriceScheduleAmount
135 , CD.NET_AMT as ClaimLinePaidAmount
136 , CD.PAID_NET_AMT as ClaimLineAmtPaidwithInt
137 , CD.CLAIM_STATUS as ClaimStatus
138 , CD.PROCESSING_STATUS as ProcessingStatus
139 , CD.POST_DATE as PostDate
140 , CD.CHECK_DATE as CheckDate
141 , CD.ALLOWED_AMT as AllowedAmount
142 , CD.PRICE_SCHEDULE as PriceScheduleAmount
143 , CD.QUANTITY as Quantity
144 , CD.NOT_COVERED_AMT as NotcoveredAmount
145 , CD.NOT_COV_QTY as NotCoveredQuantity
146 , CD.NDC_CODE
147 , MM.SEQ_MEMB_ID as MemberID
148 , MM.LAST_NAME as MemberLastName
149 , MM.FIRST_NAME as MemberFirstName
150 , MM.DATE_OF_BIRTH as MemberDOB
151 , MM.GENDER as M_F
152 , MM.MEDICAID_NO as MedicaidID
153 , PM.SEQ_PROV_ID as ProviderID
154 , PM.LAST_NAME as PROVIDERLASTNAME
155 , PM.FIRST_NAME as PROVIDERFIRSTNAME
156 , CH.INST_PROV_NPI as NATIONAL_PROVIDER_ID
157 , CH.PROVIDER_PAR_STAT as ParStatus
158 , CH.PROVIDER_TYPE as ProviderType
159 , CH.PROVIDER_SPEC as ProviderSpecialty
160 , CH.PROVIDER_PCP_FLAG as PCPFlag
161 , VM.SEQ_VEND_ID as VendorID
162 , VM.IRS_TAX_ID as VendorTaxID
163 , VM.FULL_NAME as VendorFullName
164 , CD.ALLOWED_REASON as AllowedReason
165 , CD.NOT_COVERED_REASON as NotCoveredReason
166 , CD.HOLD_REASON_1
167 , CD.HOLD_REASON_2
168 , CD.HOLD_REASON_3
169 , CH.AUTH_NUMBER
170 , CH.AUTH_TYPE
171 , CH.LINE_OF_BUSINESS as LOB
172 , 'I' as ClaimType
173 FROM
4 The SAS System 14:42 Wednesday, September 11, 2019
174 HSDREPT.INST_CLAIM_HEADER CH,
175 HSDREPT.INST_CLAIM_DETAIL CD,
176 HSDREPT.PROV_MASTER PM,
177 HSDREPT.MEMBER_MASTER MM,
178 HSDREPT.VENDOR_MASTER VM
179 WHERE
180 CH.SEQ_CLAIM_ID = CD.SEQ_CLAIM_ID
181 AND CH.SEQ_MEMB_ID = MM.SEQ_MEMB_ID
182 AND CH.SEQ_PROV_ID = PM.SEQ_PROV_ID
183 AND CH.SEQ_VEND_ID = VM.SEQ_VEND_ID
184 AND CD.POST_DATE >= '1JUL2019:0:0:0'dt
185 AND CH.LINE_OF_BUSINESS = 'NED'
186 );
WARNING: A table has been extended with null columns to perform the UNION ALL set operation.
ERROR: Column 33 from the first contributor of UNION ALL is not the same type as its counterpart from the second.
ERROR: Column 36 from the first contributor of UNION ALL is not the same type as its counterpart from the second.
ERROR: Numeric expression requires a numeric format.
ERROR: Column 37 from the first contributor of UNION ALL is not the same type as its counterpart from the second.
ERROR: Column 38 from the first contributor of UNION ALL is not the same type as its counterpart from the second.
ERROR: Column 40 from the first contributor of UNION ALL is not the same type as its counterpart from the second.
ERROR: Column 41 from the first contributor of UNION ALL is not the same type as its counterpart from the second.
ERROR: Column 43 from the first contributor of UNION ALL is not the same type as its counterpart from the second.
ERROR: Column 44 from the first contributor of UNION ALL is not the same type as its counterpart from the second.
ERROR: Column 51 from the first contributor of UNION ALL is not the same type as its counterpart from the second.
ERROR: Column 52 from the first contributor of UNION ALL is not the same type as its counterpart from the second.
ERROR: Column 59 from the first contributor of UNION ALL is not the same type as its counterpart from the second.
ERROR: Column 60 from the first contributor of UNION ALL is not the same type as its counterpart from the second.
ERROR: Numeric expression requires a numeric format.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
187 /*and &beg <= datepart(CD.POST_DATE) <= &end);*/
188 /*ORDER BY claimid claimline;*/
189 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.10 seconds
cpu time 0.05 seconds
190 run;
191
192 DATA claims1;
193 SET claims;
ERROR: File WORK.CLAIMS.DATA does not exist.
194 format FromDate THRUDATE PostDate CheckDate MemberDOB DATE_RECEIVED INSERT_DATETIME
195 datetime.;
196 RUN;
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.CLAIMS1 may be incomplete. When this step was stopped there were 0 observations and 7 variables.
WARNING: Data set WORK.CLAIMS1 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.06 seconds
cpu time 0.00 seconds
197
198
5 The SAS System 14:42 Wednesday, September 11, 2019
199
200
201 GOPTIONS NOACCESSIBLE;
202 %LET _CLIENTTASKLABEL=;
203 %LET _CLIENTPROCESSFLOWNAME=;
204 %LET _CLIENTPROJECTPATH=;
205 %LET _CLIENTPROJECTNAME=;
206 %LET _SASPROGRAMFILE=;
207
208 ;*';*";*/;quit;run;
209 ODS _ALL_ CLOSE;
210
211
212 QUIT; RUN;
213
UNION and UNION ALL attempt to stack variables by position, first column with first, second with second. So when the variables of such do not match for type the columns can't actually be combined.
If you are intending that like name variables be stacked then you need the keyword CORR such as
UNION ALL CORR
but if the variables do not have the same names any mismatched (or present in only one data set) will be excluded. And may need OUTER UNION CORR.
UNION and UNION ALL attempt to stack variables by position, first column with first, second with second. So when the variables of such do not match for type the columns can't actually be combined.
If you are intending that like name variables be stacked then you need the keyword CORR such as
UNION ALL CORR
but if the variables do not have the same names any mismatched (or present in only one data set) will be excluded. And may need OUTER UNION CORR.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: