Skip to Content
0
Former Member
Aug 22, 2007 at 10:17 PM

Issue with 0FISCYEAR in FOX

24 Views

Gurus,

Good day! I have a FOX code that works on two key figures. ZCOUNT and ZFULL. ZCOUNT is used as a FLAG. I need to execute a function such that if ZCOUNT is greater than "1" perform some computations.

The issue that I am having is, if I run the following code it checks for all the years in the 0FISCYEAR but it does not do the computation for the years other than the first year.

<u><b>CODE:</b></u>

DATA FLAG TYPE I.

DATA YR TYPE 0FISCYEAR.

.......................

..................

............

FLAG = 0.

FOREACH YR.

FLAG = {ZCOUNT,YR,XX,YY...}.

IF FLAG > 0.

{ZCOUNT,YR,XX,YY...} = 1.

.......................

..................

............

ELSE.

{ZFULL,YR,XX,YY...} = 0.

{ZCOUNT,YR,XX,YY...} = 0.

.......................

..................

............

ENDIF.

ENDFOR.

The Output is of the format

YR XX ...... ZFULL ZCOUNT

2007 01 30,000.00 8

<b>2007 01 30,000.00 1</b> (correct for year 2007)

2008 01 20,000.00 8

<b>2008 01 20,000.00 0</b> (wrong for the following years)

<b>EXPECTED OUTPUT</b>

YR XX ...... ZFULL ZCOUNT

2007 01 30,000.00 8

2007 01 30,000.00 1

2008 01 20,000.00 8

2008 01 20,000.00 1

Please guide me!!!

Thanks