Focal Point
[SOLVED]Format a number from a hold file

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1587015196

August 22, 2019, 01:01 PM
Trudy
[SOLVED]Format a number from a hold file
I have a PRINT field that I convert from a D20.2 to an I3 that gets put in a hold file, XFOCUS or FOCUS format. When I use the field as a BY field from the hold file the formatting reverts back to its original D20.2 and I can't seem to reformat it. Any idea how to go about this and why this is happening?

 
PRINT
HIGH_SCHOOL_RANK/I3
....
ON TABLE HOLD AS INITHLD FORMAT XFOCUS INDEX 'PIDM_KEY'
....
JOIN.....

BY HIGH_SCHOOL_RANK AS 'HS Rank'
 


Thanks

This message has been edited. Last edited by: Trudy,


WF8
Windows
August 22, 2019, 01:24 PM
MartinY
Look at this
TABLE FILE CAR
BY COUNTRY/A50V
ON TABLE HOLD AS TMP FORMAT FOCUS
END


It result in that
FILENAME=TMP, SUFFIX=FOC     ,
 DATASET=tmp.foc, $
  SEGMENT=SEG01, SEGTYPE=S0, $
    FIELDNAME=COUNTRY, ALIAS=E01, USAGE=A50V,
      TITLE='COUNTRY', $
    FIELDNAME=COUNTRY, ALIAS=E02, USAGE=A10, $


Then this
TABLE FILE CAR
BY COUNTRY/A50V AS 'N_COUNTRY'
ON TABLE HOLD AS TMP FORMAT FOCUS
END


Result in that
FILENAME=TMP, SUFFIX=FOC     ,
 DATASET=tmp.foc, $
  SEGMENT=SEG01, SEGTYPE=S0, $
    FIELDNAME=N_COUNTRY, ALIAS=E01, USAGE=A50V,
      TITLE='N_COUNTRY', $
    FIELDNAME=COUNTRY, ALIAS=E02, USAGE=A10, $


Since you have not renamed the redefined field, you have twice the same field name in your master file and it seems that it's the old one that is used in your subsequent TABLE FILE


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
August 22, 2019, 01:30 PM
Tom Flynn
TABLE FILE CAR
BY COUNTRY/A50V
ON TABLE HOLD AS TMP FORMAT FOCUS
END
-RUN
?FF TMP
-EXIT

Results:

FILENAME= TMP
COUNTRY E01 A50V
COUNTRY E02 A10

So, Add:
SET HOLDLIST=PRINTONLY
TABLE FILE CAR
BY COUNTRY/A50V
ON TABLE HOLD AS TMP FORMAT FOCUS
END
-RUN
?FF TMP
-EXIT

Results:

FILENAME= TMP
COUNTRY E01 A50V


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 22, 2019, 01:38 PM
MartinY
quote:
Originally posted by Tom Flynn:

So, Add:
SET HOLDLIST=PRINTONLY


Also another option as usual in WF

Good One


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007