Focal Point
[SOLVED] (FOC015) THE TEST VALUE IS LONGER THAN THE FIELD FORMAT LENGTH

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

September 13, 2017, 11:04 AM
Genius
[SOLVED] (FOC015) THE TEST VALUE IS LONGER THAN THE FIELD FORMAT LENGTH
hi,

i have below code and its throwing below error , im guessing its IF else statemnet issue but could not resolve it . if someone can help me with it/

(FOC015) THE TEST VALUE IS LONGER THAN THE FIELD FORMAT LENGTH: HOME ROAMER MSG

CODe is as below

  
 -IF 0      NE 0 GOTO ERR;
 -*
 DEFINE FILE UPCS15
 BILL_C/A7='/   ';
 CYCOD_C/A2=' ';
 AIR_DUR_LLK/P16.4=AIR_DUR_IN_MIN;
 TOLL_DUR_LLK/P16.4=TOLL_DUR_IN_MIN;
 -*  chnage
 SORT1/A7 = IF MESSAGE_TYPE EQ 'HOME MSG'        THEN 'HOME'
       ELSE IF MESSAGE_TYPE EQ 'ROAMING MSG'     THEN 'ROAMING'
       ELSE IF MESSAGE_TYPE EQ 'HOME ROAMER MSG' OR 'EXT. HOME MSG' THEN 'HRM'
       ELSE IF MESSAGE_TYPE EQ 'GPRS ROAM MSG'   THEN 'GPRS' ;
 -*
 SORT2/A9=SORT1||CANCEL_IND||BALANCE_DATE;
 SORTP/A15=SORT2||AIR_FREE_CODE_IND||CALL_FRWD_IND;
 -*
 END
 -RUN



and mas file has structure as below

FILE=upcs15 ,SUFFIX=FIX
SEGNAME=FIRST
FIELDNAME=FTR_SERVICE_TYPE ,ALIAS= ,FORMAT=A1 ,ACTUAL=A1 ,$
FIELDNAME=SUB_MARKET_CODE ,ALIAS= ,FORMAT=A3 ,ACTUAL=A3 ,$
FIELDNAME=CANCEL_IND ,ALIAS= ,FORMAT=A1 ,ACTUAL=A1 ,$
FIELDNAME=CANCELING_ENTITY ,ALIAS= ,FORMAT=A1 ,ACTUAL=A1 ,$
FIELDNAME=MESSAGE_TYPE ,ALIAS= ,FORMAT=A13 ,ACTUAL=A13 ,$
FIELDNAME=BALANCE_DATE ,ALIAS= ,FORMAT=A1 ,ACTUAL=A1 ,$
FIELDNAME=AIR_FREE_CODE_IND,ALIAS= ,FORMAT=A1 ,ACTUAL=A1 ,$
FIELDNAME=CALL_FRWD_IND ,ALIAS= ,FORMAT=A1 ,ACTUAL=A1 ,$
FIELDNAME=NUM_OF_USG ,ALIAS= ,FORMAT=I9 ,ACTUAL=I4 ,$
FIELDNAME=AIR_CHARGES ,ALIAS= ,FORMAT=P13.2 ,ACTUAL=P6 ,$
FIELDNAME=AIR_DUR_IN_MIN ,ALIAS= ,FORMAT=P19.4 ,ACTUAL=P9 ,$
FIELDNAME=TOLL_CHARGES ,ALIAS= ,FORMAT=P13.2 ,ACTUAL=P6 ,$
FIELDNAME=TOLL_DUR_IN_MIN ,ALIAS= ,FORMAT=P19.4 ,ACTUAL=P9 ,$
FIELDNAME=AC_CHARGES ,ALIAS= ,FORMAT=P13.2 ,ACTUAL=P6 ,$
FIELDNAME=TAXES ,ALIAS= ,FORMAT=P13.2 ,ACTUAL=P6 ,$



Thanks in advance for ur help

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS, Linux
Excel, CSV
September 13, 2017, 11:09 AM
Tony A
quote:
IF MESSAGE_TYPE EQ 'HOME ROAMER MSG'

FIELDNAME=MESSAGE_TYPE ,ALIAS= ,FORMAT=A13 ,ACTUAL=A13 ,$


You really cannot work this one out?

Perhaps it's time to take a maths class?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
September 13, 2017, 11:12 AM
Kofi
quote:
Perhaps it's time to take a maths class?

... or be change you screen name? Smiler

Kofi


Client Server 8.1.05: Apache; Tomcat;Windows Server 2012
Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012
September 13, 2017, 11:32 AM
Genius
hi,

I already tried code with changing size to A15/A13 still showing same error.


WebFOCUS, Linux
Excel, CSV
September 13, 2017, 11:45 AM
Francis Mariani
quote:
HOME ROAMER MSG

The string is longer than the ACTUAL length, as defined in the metadata for table or file you're reading.

If you view the data in the table or file, do you see that value?

How was the metadata for this table or file created?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 13, 2017, 11:50 AM
j.gross
quote:
Originally posted by Genius:
...
SORT1/A7 = IF MESSAGE_TYPE EQ 'HOME MSG' THEN 'HOME'
ELSE IF MESSAGE_TYPE EQ 'ROAMING MSG' THEN 'ROAMING'
ELSE IF MESSAGE_TYPE EQ 'HOME ROAMER MSG' OR 'EXT. HOME MSG' THEN 'HRM'
ELSE IF MESSAGE_TYPE EQ 'GPRS ROAM MSG' THEN 'GPRS' ;
...


Just to note in passing -- In a cascade of "if then else" clauses in a Define, always provide a final "ELSE '...'", to control what happens when none of the conditions is fired.

As it stands, if MESSAGE_TYPE is none of the above in a particular incoming record, then the value for SORT1 is unspecified (and will probably be the holdover value from the previous record). And it looks like incoming values of 'HOME ROAMER M', which is none of the above, can be anticipated.
September 13, 2017, 12:17 PM
Tony A
If this came across a bit harsh then I apologise .... However,

You really need to do your searches before you post questions like this because most of what you have asked has arisen and been answered before. A little research on your part would likely have given you indications of what the issue was. You then have to really examine what the message is telling you and you should be able to work out the resolution.


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
September 13, 2017, 12:34 PM
Francis Mariani
How many people does it take to help a genius? Big Grin


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server