Converting SQL Server While Loop to Teradata

Database
N/A

Converting SQL Server While Loop to Teradata

Let's say I have this code in SQL Server, it should loop through twice. 

DECLARE @dateVar INT

SET @dateVar = 1

WHILE (@dateVar < 3)

BEGIN

SELECT 1

SET @dateVar = @dateVar + 1

END

I have tried to do a similar syntax in Teradata as a macro, however I'm getting error 3707. Please help. Thanks.

CREATE  MACRO FirstMacro (

dateVar INT

) AS (

SET :dateVar = 1 

WHILE :datevar < 3

BEGIN

LOCKING ROW FOR ACCESS

SELECT 1;

SET :datevar = ;datevar+1

END

);