search x and replace with Y IF (eviews 7)
Posted: Thu Apr 29, 2010 1:35 pm
Hi
I have a series with 65,000 observations where the value varies from 1 to 12
I need to find values 1 to 3, 4 though 6, 7 through 9 and 10 through 12 then generate a new series containing values of 1, 2, 3, or 4 in the approrpiate cells
I've been attempting this with the following code to no avail
Any suggestions would be appreciated
program mytest
workfile test u 1 65535
fetch allbids09:: openingdate
' transforming date string to common units
series test=@datepart(openingdate, "mm")
series test2=@datepart(openingdate, "yy")
if test >=1 and test <=3 then
series qrtr =1
if test >3 and test <=6 then
series qrtr2=2
if test>6 and test <=9 then
series qrtr3=3
'if test>9 and test <=12 then
series qrtr4=4
endif
endif
endif
endif
I have a series with 65,000 observations where the value varies from 1 to 12
I need to find values 1 to 3, 4 though 6, 7 through 9 and 10 through 12 then generate a new series containing values of 1, 2, 3, or 4 in the approrpiate cells
I've been attempting this with the following code to no avail
Any suggestions would be appreciated
program mytest
workfile test u 1 65535
fetch allbids09:: openingdate
' transforming date string to common units
series test=@datepart(openingdate, "mm")
series test2=@datepart(openingdate, "yy")
if test >=1 and test <=3 then
series qrtr =1
if test >3 and test <=6 then
series qrtr2=2
if test>6 and test <=9 then
series qrtr3=3
'if test>9 and test <=12 then
series qrtr4=4
endif
endif
endif
endif