I am trying to use HDIFF to calculate the number of Days from start of a visit to end of same.
I have posted the code and error message below:
-SET &BEG1 = '20081201';
-SET &END1 = '20081231';
-*
DEFINE FILE BLAH-BLAH
-* ADMT DATE CODE BELOW
ADMTDTTM/HYYMDS = HGETC(ADMIT_DATE, 'HYYMDS');
1DATEALPHA/A8 = EDIT(ADMIT_DATE,'$99999999');
1TIMEALPHA/A6 = EDIT(ADMIT_TIME,'$999999');
1DATETIMEALPHA/A14 = 1DATEALPHA || 1TIMEALPHA;
ADSCHDTM/HYYMDS = HINPUT(14, 1DATETIMEALPHA, 8, 'HYYMDS');
-* DSCH DATE CODE BELOW
DSCHDTTM/HYYMDS = HGETC(DISCHARGE_DATE, 'HYYMDS');
DATEALPHA/A8 = EDIT(DISCHARGE_DATE,'$99999999');
TIMEALPHA/A6 = EDIT(TIME_OF_DISCHARGE,'$$$$$$$999999');
DATETIMEALPHA/A14 = DATEALPHA || TIMEALPHA;
DSCHDTTM/HYYMDS = HINPUT(14, DATETIMEALPHA, 8, 'HYYMDS');
END
-*
TABLE FILE BLAH-BLAH
PRINT
ADSCHDTM
DSCHDTTM
-*STAY/D12.2 = HDIFF(ADSCHDTTM,DSCHDTTM,'MINUTE','D12.2');
DIFF_DAYS/D12.2 = HDIFF(ADSCHDTM, DSCHDTTM, 'DAY', 'D12.2');
-*STAY_HRS/D12.2 = STAY_DUR/60;
-*
BY ENCOUNTER_NUMBER AS 'EDP#'
WHERE COMPANY_CODE EQ '70';
WHERE INOUT_CODE EQ 'I';
WHERE DISCHARGE_DATE FROM '20081201' TO '20081231';
IF RECORDLIMIT EQ 60
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE HOLD AS F1
END
-RUN
0 ERROR AT OR NEAR LINE 32 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC002) A WORD IS NOT RECOGNIZED: DIFF_DAYS/D12.2
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT
-*
? HOLD F1
-RUN
0NO HOLD FILE CURRENTLY ACTIVE
-*
However, if I use the same code and EXCLUDE the DIFF_DAYS line, I see that the two date fields
are the correct format...?????
-*
[CODE]
? HOLD F1
-RUN
0DEFINITION OF HOLD FILE: F1
0FIELDNAME ALIAS FORMAT
ENCOUNTER_NUMBER E01 A20
ENCOUNTER_NUMBER E02 A20
CNTR E03 I9
ADSCHDTM E04 HYYMDS
DSCHDTTM E05 HYYMDS
-*
Anyone?
Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36