I have the following SQL Statment:
Exec SQL
Select
-- Payment Transaction Count
Sum(Case EpArTrnTp
When 'PA' Then 1 Else 0 End),
-- Payment Total Amount
Sum(Case EpArTrnTp
When 'PA' Then EpArTrAm Else 0 End,
-- Invoice/Credit Transaction Count
Sum(Case
When EpArTrnTp in ('IN','CM') Then 1 Else 0 End),
-- Invoice Total Amount
Sum(Case EpArTrnTp
When 'IN' Then EpArTrAm Else 0 End,
-- Credit Total Amount
Sum(Case EpArTrnTp
When 'CR' Then EpArTrAm Else 0 End,
-- Adjustment Transaction Count
Sum(Case
When EpArTrnTp in ('DM','NC') Then 1 Else 0 End),
-- Adjustment Total Charge Back Amount
Sum(Case EpArTrnTp
When 'DM' Then EpArTrAm Else 0 End,
-- Adjustment Return Check Amount
Sum(Case EpArTrnTp
When 'NC' Then EpArTrAm Else 0 End
Into
:Payment_Transaction_Count,
:Payment_Total,
:Off_Line_Transaction_Count,
:Off_Line_Invoice_Total,
:Off_Line_Credit_Total,
:Adjustment_Transaction_Count,
:Adjustment_CB_Total
:Adjustment_Debit_Total
From VXbEpDArt
Group by EpArTrnTp; // Invoice & Credits Only
My fields are defined as follows:
D Off_Line_Invoice_Total...
D S Like(##Bal)
D Off_Line_Credit_Total...
D S Like(##Bal)
D Off_Line_Transaction_Count...
D S Like(##Trn_Cnt)
D Adjustment_Debit_Total...
D S Like(##Bal)
D Adjustment_Credit_Total...
D S Like(##Bal)
D Adjustment_CB_Total...
D S Like(##Bal)
D Adjustment_Transaction_Count...
D S Like(##Trn_Cnt)
D Payment_Total...
D S Like(##Bal)
D Payment_Transaction_Count...
D S Like(##Trn_Cnt)
##Bal = 11.2
##Trn_Cnt = 3.0
When I attempt to complie, I receive the following messages from the
pre-compiler:
Position 18 Token EPARTRNTP was not valid. Valid tokens:
, FROM INTO.
Position 12 Keyword INTO not expected. Valid tokens: ) ,.
Position 14 Indicator variable ADJUSTMENT_DEBIT_TOTAL
not SMALLINT type.
What am I doing wrong?
Thanks,
As an Amazon Associate we earn from qualifying purchases.