need to Compare header date in file 1 with system date in file 2

Analytics
Enthusiast

need to Compare header date in file 1 with system date in file 2

I have 2 input files i.e file 1 and file2
file 1 is header file which contains date as 02/27/2006
file 2 contains system date
i have to compare file1 and file2 dates if they match i need to process otherwise needs to abend
how can i write Teradata sql

Help me in this regard
Thanks in advance and also thanks for earlier replys to my questions

Regards
Chinnababu
2 REPLIES
Enthusiast

Re: need to Compare header date in file 1 with system date in file 2

Hi,

If u r on unix platform, use a shell script for this.

Regds,
sachin
Enthusiast

Re: need to Compare header date in file 1 with system date in file 2


Hi chinna babu,

If you have extracted files into some temp tables then you can try this one

SELECT 'X'
FROM FILE1_TEMP FT1
INNER JOIN
FILE2_TEMP FT2
ON FT1.DATE = FT2.DATE;
IF ACTIVITY_COUNT <> 1 THEN .QUIT(i.e abend the job with some errorcode)

If dates are equal you need to not handle, the process continues itself.

regards