.DISPLAY in MLOAD

Tools & Utilities
Enthusiast

.DISPLAY in MLOAD

Hi,

I have a file which contain date fields. There is a possibility in which one of the fields can be blank so i am using .DISPLAY command to output the message to MVS. But it gives the error "End of file was reached with an unbalanced number of comment,begin and ends being found in the text."
Errorcode = 8
I want a functionality in which whenever any of the date field is empty it should display a message on the output screen and logoff.

Here is my code/job output :

.LOGTABLE BIS.WWZ016_SUBACCT_EXTN_DI_T1_MLOG;
DATABASE BIS;
DELETE FROM BIS.WWZ016_SUBACCT_EXTN_DI_T1;
.BEGIN IMPORT MLOAD
TABLES WWZ016_SUBACCT_EXTN_DI_T1
WORKTABLES WWZ016_SUBACCT_EXTN_DI_T1_WT
ERRORTABLES WWZ016_SUBACCT_EXTN_DI_T1_ET
WWZ016_SUBACCT_EXTN_DI_T1_UV
AMPCHECK NONE;
.LAYOUT INFILE_LAYOUT;
.FIELD IN_SUB_ACCT_ID * CHAR(11) ;
.FIELD IN_DI_CUST_NBR * CHAR(12) ;
.FIELD IN_DI_LOCATION_NBR * CHAR(12) ;
.FIELD IN_EMP_ID * CHAR(06) ;
.FIELD IN_DI_SALES_REP_ID * CHAR(06) ;

.ACCEPT COMPANY_CD
,PRIOR_MONTH_BEG_DT
,PRIOR_MONTH_END_DT
,CURR_MONTH_BEG_DT
,CURR_MONTH_END_DT
FROM FILE CTRLDT;

.IF '&CURR_MONTH_BEG_DT' = ' ' THEN;
.DISPLAY 'Z016M1.001 ERROR OCCURED WHEN ACCEPTING CURR_MONTH_BEG_DT'
TO FILE *;
.LOGOFF 666;
.ENDIF;

.DISPLAY 'COMPANY_CD=' TO FILE *;
.DISPLAY '&COMPANY_CD' TO FILE *;
.DISPLAY 'PRIOR_MONTH_BEG_DT=' TO FILE *;
.DISPLAY '&PRIOR_MONTH_BEG_DT' TO FILE *;
.DISPLAY 'PRIOR_MONTH_END_DT=' TO FILE *;
.DISPLAY '&PRIOR_MONTH_END_DT' TO FILE *;
.DISPLAY 'CURR_MONTH_BEG_DT=' TO FILE *;
.DISPLAY '&CURR_MONTH_BEG_DT' TO FILE *;
.DISPLAY 'CURR_MONTH_END_DT=' TO FILE *;
.DISPLAY '&CURR_MONTH_END_DT' TO FILE *;
.DML LABEL INSERT_RECORDS;
INSERT INTO WWZ016_SUBACCT_EXTN_DI_T1
(
SUB_ACCT_ID
,DI_CUST_NBR
,DW_START_DT
,DW_END_DT
,DI_LOCATION_NBR
,DI_SALES_REP_ID
,EMPL_ID
,CURR_IND
,ACTV_IND
,INACTV_DT
,DW_GEN_IND
,MODIFIED_BY
,MODIFIED_DT
)
VALUES
(
:IN_SUB_ACCT_ID
,CASE WHEN :IN_DI_CUST_NBR = ' ' THEN 'UK'
ELSE :IN_DI_CUST_NBR END
,'&CURR_MONTH_BEG_DT' (DATE, FORMAT 'YYYYMMDD')
,'5555-12-31'
,CASE WHEN :IN_DI_LOCATION_NBR = ' ' THEN 'UK'
ELSE :IN_DI_LOCATION_NBR END
,CASE WHEN :IN_DI_SALES_REP_ID = ' ' THEN 'UK'
ELSE :IN_DI_SALES_REP_ID END
,CASE WHEN :IN_EMP_ID = ' ' THEN 'UK'
ELSE :IN_EMP_ID END
,'Y'
,'Y'
,'5555-12-31'
,'N'
,'WWZ016M1'
,CURRENT_DATE
)
;
.IMPORT INFILE INDATA1
LAYOUT INFILE_LAYOUT
APPLY INSERT_RECORDS;
.END MLOAD;
**** 04:18:25 UTY3402 End of file was reached with an unbalanced number of comments,begin and ends being found in the text."
**** 04:18:25 UTY2410 Total processor time used = '0.00994792 Seconds'
. Start : 04:18:25 - TUE JAN 03, 2006
. End : 04:18:25 - TUE JAN 03, 2006
. Highest return code encountered = '8'.

It executes the whole code before giving the error. ideally it should log off after it finds an empty filed in the CTRLDT file.

Thanks
Anjali
1 REPLY
hh
Enthusiast

Re: .DISPLAY in MLOAD

maybe instead of listing the field as empty, populate it with ***** or something unique, see if the script works...