This is fine if the format of &FIELDNAME is alpha. Not fine if the format of &FIELDNAME is numeric. I can use EDIT or FOTA or PTOA to convert the numeric to aplha but it is not happy when &FIELDNAME is alpha.
From the looks of it I'll have to use two different methods depending on the format of &FIELDNAME. Is there a way to test the format of a field? Sort of like IF &FIELDNAME.FORMAT EQ...
Thanks,
DanThis message has been edited. Last edited by: Dan Pinault,
7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
August 26, 2009, 12:45 PM
GinnyJakes
CHECK FILE CAR HOLD
TABLE FILE HOLD
PRINT FIELDNAME FORMAT
END
Maybe you can join or do some sort of lookup into the output of a request like this so that you can test the format.
CHECK FILE filename HOLD
-RUN
-IF &LINES EQ 0 THEN bad.MFD;
TABLEF FILE HOLD
WRITE FST.USAGE
WHERE FIELDNAME EQ '&fieldname' OR ALIAS EQ '&fieldname';
ON TABLE SAVE
END
-RUN
-IF &LINES EQ 0 THEN bad.FLD;
-READ SAVE, &USAGE
-SET &FTYPE=EDIT(&USAGE,'9');
Take it from there?
- Jack Gross WF through 8.1.05
August 26, 2009, 12:56 PM
Doug
quote:
Is there a way to test the format of a field? Sort of like IF &FIELDNAME.FORMAT EQ...
How ablout the .TYPE option which returns an 'A' or an 'N'? such as: