[focus-l] Re: TRUNCATION

  • From: "Mickey Grackin" <mgrackin@xxxxxxxx>
  • To: <focus-l@xxxxxxxxxxxxx>
  • Date: Wed, 5 May 2004 12:08:48 -0400

If the FUND value is found in GS it will return whatever you specify as the
return value in the GS file for that FUND value.  If FUND value is not found
in the GS file then the 1 will be returned.  Remember, a DECODE must always
have pairs of values.  One part of the pair is the value you are looking for
(FUND) and the other part of the pair is the return value.
TAKE/I1=DECODE FUND(GS ELSE 1);

Assume FUND is an A2, GS will contain the following:

10 9
20 9
30 9
40 9
50 9

Is this example, the DECODE will return the number 9 if FUND contains 10,
20, 30, 40, or 50.  If FUND is not found, then 1 is returned.  You can make
the return value anything you would like to as long as the format of TAKE is
appropriate to receive the value.

Mickey Grackin
(301) 975-8417

 -----Original Message-----
From:   focus-l-bounce@xxxxxxxxxxxxx [mailto:focus-l-bounce@xxxxxxxxxxxxx]
On Behalf Of Hamilton, Robert
Sent:   Wednesday, May 05, 2004 11:48 AM
To:     focus-l@xxxxxxxxxxxxx
Subject:        [focus-l] Re: TRUNCATION

This is a very simple task and I got off track by trying to follow the
FOCUS=20
Manual pp 9-80 to 9-82  ;
Here's the deal; there is a file w/ ssn, fund, bal , h ; if fund is in
a  list of funds noted by ddname gs then I want to create a new fld
based on
Values of h.

My question now is if I use  take =3D DECODE FUND(GS ELSE 1); FROM THE
MANUAL

IS take supposed to be 0/1 or is it the value of fund.  In one place the

Manual leads me to believe one way; the next sentence the other.  Can
anyone
Shine some light - even a glimmer - at the end of the tunnel?

Thnx

bobh



-----Original Message-----
From: focus-l-bounce@xxxxxxxxxxxxx [mailto:focus-l-bounce@xxxxxxxxxxxxx]
On Behalf Of Mickey Grackin
Sent: Wednesday, May 05, 2004 7:50 AM
To: focus-l@xxxxxxxxxxxxx
Subject: [focus-l] Re: TRUNCATION

Bobh,
You are trying to set COL1 equal to either O_B or '0'.  The first
problem I
see is that you have quotes around the zero.  That makes FOCUS expect an
Alpha format field on the left hand side of the expression, so remove
the
quotes.  Second, what is the format of O_B?  If that's and Alpha field
you
can't assign it to COL1 with a format of P6.  I'm not sure why FOCUS
says
there is a FORMAT ERROR IN DECODE.  It could be that FOCUS just doesn't
like
the way you are embedding it into the IF statement.

Just some observations.

Mickey Grackin
(301) 975-8417

 -----Original Message-----
From:   focus-l-bounce@xxxxxxxxxxxxx
[mailto:focus-l-bounce@xxxxxxxxxxxxx]
On Behalf Of Hamilton, Robert
Sent:   Tuesday, May 04, 2004 5:38 PM
To:     focus-l@xxxxxxxxxxxxx
Subject:        [focus-l] Re: TRUNCATION

Thnx, Ron


Then I get for this

COL1/P6    =3D3D  IF ((DECODE FUND(GS ELSE 'X') NE 'X' )
      AND     (  HOUSING EQ '1' OR '2' )  ) THEN O_B ELSE '0';


I get this

  COL1/P6    =3D3D  IF ((DECODE FUND(GS ELSE 'X') NE 'X' )
ERROR AT OR NEAR LINE     54  IN PROCEDURE ADHO0503FOCEXEC
FOC272) FORMAT ERROR IN DECODE OR FILE ELEMENT: X
        AND     (  HOUSING EQ '1' OR '2' )  ) THEN O_B ELSE '0';


GS points to a file with a list of funds but if I make col1 /a001
Then no error.

?????




bobh










-- Binary/unsupported file stripped by Ecartis --
-- Type: application/ms-tnef
-- File: winmail.dat








-- Binary/unsupported file stripped by Ecartis --
-- Type: application/ms-tnef
-- File: winmail.dat



Other related posts: