an IF problem

I would like to avoid to write in a csv file all the data scraped IF "date" variable is zero.
the script is
out.write( session.getVariable( "CODE" )+ "," );
out.write( session.getVariable( "WIND" )+ "," );
out.write( session.getVariable( "TMAX" )+ "," );
out.write( session.getVariable( "TMIN" )+ "," );
out.write( session.getVariable( "WIND") + "," );
out.write( session.getVariable( "DATE" )+ "," );

i tried with:
if (dataRecord.get("DATE") != null)
{
out.write( session.getVariable( "CODE" )+ "," );
out.write( session.getVariable( "WIND" )+ "," );
out.write( session.getVariable( "TMAX" )+ "," );
out.write( session.getVariable( "TMIN" )+ "," );
out.write( session.getVariable( "WIND") + "," );
out.write( session.getVariable( "DATE" )+ "," );
}
but in the csv file I see the date with DATE= 0
please help me
Fabio

Wouldn't you just alter the

Wouldn't you just alter the if to be

if (dataRecord.get("DATE")!=null && !dataRecord.get("DATE").equals("0"))