Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
Hi I have a code like this.
IF not IsNull(TableNumber('SBLC_TYPE_MAP')) THEN
Trace SBLC_TYPE_MAP table found;
Concatenate (SBLC_TYPE_MAP)
Mapping LOAD
IF(ACCOUNT_DEAL_ID_001='','NOACCTID',ACCOUNT_DEAL_ID_001)&'_'&IF(FTP_ARRANGEMENT_LOC_NUM_241='','NOALN',FTP_ARRANGEMENT_LOC_NUM_241) AS CONTRACT_REFERENCE,
SBLC_TYPE_057
FROM [$(vCDMPathEXTQVD)EXT_HNAH_STG_WHO_PRODUCT_$(vRptDate).qvd] (qvd);
ELSE
Trace SBLC_TYPE_MAP table not found;
SBLC_TYPE_MAP:
Mapping LOAD
IF(ACCOUNT_DEAL_ID_001='','NOACCTID',ACCOUNT_DEAL_ID_001)&'_'&IF(FTP_ARRANGEMENT_LOC_NUM_241='','NOALN',FTP_ARRANGEMENT_LOC_NUM_241) AS CONTRACT_REFERENCE,
SBLC_TYPE_057
FROM [$(vCDMPathEXTQVD)EXT_HNAH_STG_WHO_PRODUCT_$(vRptDate).qvd] (qvd);
next a
and getting error like below:
$(vRptDate) = Date
If I change my code like below and every thing is fine
SBLC_TYPE_MAP:
Mapping LOAD
IF(ACCOUNT_DEAL_ID_001='','NOACCTID',ACCOUNT_DEAL_ID_001)&'_'&IF(FTP_ARRANGEMENT_LOC_NUM_241='','NOALN',FTP_ARRANGEMENT_LOC_NUM_241) AS CONTRACT_REFERENCE,
SBLC_TYPE_057
FROM [$(vCDMPathEXTQVD)EXT_HNAH_STG_WHO_PRODUCT_$(vRptDate).qvd] (qvd);
next a
*******************
I am using the same code for other tables and no issue found
for ex:
IF NOT IsNull(TableNumber('CRC_RANK_MAP')) THEN
Trace CRC_RANK_MAP table found;
Concatenate (CRC_RANK_MAP)
Mapping LOAD
COUNTRY_CODE as INCORPORATION_COUNTRY,
ATTRIBUTE_1
FROM [$(vCDMPathEXTQVD)EXT_COUNTRY_$(vRptDate).qvd] (qvd);
ELSE
Trace CRC_RANK_MAP table not found;
CRC_RANK_MAP:
Mapping LOAD
COUNTRY_CODE as INCORPORATION_COUNTRY,
ATTRIBUTE_1
FROM [$(vCDMPathEXTQVD)EXT_COUNTRY_$(vRptDate).qvd] (qvd);
ENDIF
next a
Can some pls help me in this error.
I am a little confused by your post, but the statement "next a" needs a "for a = ...." somewhere and I don't see that. I don't see an END IF for the last IF, so even if there is a "for", it will fail because the "next" is inside an IF statement, which is not allowed. Therefore it looks like you are missing an END IF or ENDIF.
In your working example, the second IF is closed before the next. If this is working there is a for somewhere not included in your post.
Remove the Next a remove try it
That is loop to get updte the dates in $(vRptDate).
comment //next a
There is no for statement in your script. Obviously, you will get this error. Is this your full code.?
This is the loop
All_MI_Context:
LOAD Serial,
REPORT_DATE
FROM
'$(vCDMPathEXTQVD)EXT_ALL_MI_CONTEXTS.qvd'(qvd)
;
NoConcatenate
All_RptDates:
Load * Resident All_MI_Context
Order By Serial;
Drop Table All_MI_Context;
IF NoOfRows('All_RptDates') > 0 THEN
If $(vHistoric)=1 THEN
Let vCount = NoOfRows('All_RptDates');
Trace $(vCount);
ELSE
Let vCount = 3;
ENDIF
ELSE
Trace 'No Date Found.';
EXIT SCRIPT;
ENDIF
//Let vCount = 4;
for a = $(vFromMonth) to $(vCount)-1
Let vRptDate = peek('REPORT_DATE',a,'All_RptDates');
//Let vRpt_Date = Replace(peek('REPORT_DATE',a,'All_RptDates'),'-','_');
Trace 'All_RptDates: $(vRptDate)';
Trace 'A= $(a)';
I am a little confused by your post, but the statement "next a" needs a "for a = ...." somewhere and I don't see that. I don't see an END IF for the last IF, so even if there is a "for", it will fail because the "next" is inside an IF statement, which is not allowed. Therefore it looks like you are missing an END IF or ENDIF.
In your working example, the second IF is closed before the next. If this is working there is a for somewhere not included in your post.
Thanks Jonathan... Missed - END IF