Focal Point
[SOLVED] Concatenated Alpha and Date In a Define

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

March 19, 2009, 04:20 PM
ColdWhiteMilk
[SOLVED] Concatenated Alpha and Date In a Define
I've got a define that I'm trying to build based on the values in other fields.

The "CUSTOMER_APPROVAL_DEADLINE" is a MDYY field.

The "REQUEST_STATUS" is a A100 field

What I'm trying to do is:

If there is no value for "CUSTOMER_APPROVAL_DEADLINE", then return a " | " character string, and the "REQUEST_STATUS" field value concatenated to it:

| Awaiting Functional Review

If there is value for "CUSTOMER_APPROVAL_DEADLINE", then return a " | CD: " character string, and the "CUSTOMER_APPROVAL_DEADLINE" field value concatenated to it:

| CD: 03/23/09 | Awaiting Customer Approval

When I run the code below, I get an error that "(FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD: CUSTAPPDT4"

Does anyone know how to concatenate a define and a field in a define?


My code:

DEFINE FILE WORKLOAD
DELIM_XX/A3= ' | ';
DELIM_CD/A7= ' | CD: ';
CUSTAPPDT4/A255=IF CUSTOMER_APPROVAL_DEADLINE EQ '' THEN DELIM_XX | REQUEST_STATUS ELSE DELIM_CD | CUSTOMER_APPROVAL_DEADLINE;
END


TABLE FILE WORKLOAD
PRINT
CUSTAPPDT4 AS ''

ON TABLE PCHOLD FORMAT HTML
END

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


Production - 7.6.4
Sandbox - 7.6.4
March 19, 2009, 04:33 PM
Danny-SRL
CWM,

1. If you want to concatenate all fields must be alpha.
2. If there is no value for CUSTOMER_APPROVAL_DEADLINE then either it is 0 or it is null, depending on how it is defined.

So:
  
DEFINE FILE WORKLOAD
DELIM_XX/A3= ' | ';
DELIM_CD/A7= ' | CD: ';
CAD/A8DMYY=CUSTOMER_APPROVAL_DEADLINE;
CUSTAPPDT4/A255=IF CUSTOMER_APPROVAL_DEADLINE EQ 0
   THEN DELIM_XX | REQUEST_STATUS
   ELSE DELIM_CD | CAD;
END




Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

March 19, 2009, 05:09 PM
ColdWhiteMilk
Thank you Danny.

This is what wound up working:

DEFINE FILE WORKLOAD
DELIM_CD/A7= ' | CD: ';
DELIM_XX/A3= ' | ';
CUSTAPPDT0/A8MDYY=WORKLOAD.CUSTOMER_APPROVAL_DEADLINE;
CUSTAPPDT1/A500=IF WORKLOAD.CUSTOMER_APPROVAL_DEADLINE EQ '' 
     THEN DELIM_XX | WORKLOAD.REQUEST_STATUS 
     ELSE DELIM_CD | EDIT(CUSTAPPDT0,'99/99/9999');
END

TABLE FILE WORKLOAD
PRINT
CUSTAPPDT1 AS ''

ON TABLE PCHOLD FORMAT HTML
END




Production - 7.6.4
Sandbox - 7.6.4