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
June 18, 2007, 06:17 PM
Darin Lee
Interesting. If you add .EVAL to ' A&ARGL1' in the SUBSTR function, you get the right length. Someone explain that one.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
June 18, 2007, 06:34 PM
susannah
quote:
(&USER_NAME1.LENGTH
i'm thinking its the .LENGTH thing. I've gotten different results using .LENGTH and using ARGLEN. so i only use ARGLEN now, unless i'm absobloodylutely sure that the .LENGTH of some inbound parm can never be user-tinkered-with.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
June 19, 2007, 05:27 AM
hammo1j
Fran
Your syntax is incorrect - you are passing the length as the string AamperARGL1. WF is allowing but misinterpreting this.
ARGLEN searches from the right to find the first non blank character.
.length is the length of a dm variable including any trailing blanks.
Regards
John
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
June 19, 2007, 05:53 AM
Alan B
Francis, this is actually less weird than you think.
Darin is correct, the .EVAL works.
What is happening is that the 'A&ARGL1' is literally being passed to the function. You can get the same result by using 'XYZ' or ' ' as the last parameter. The functions are ignoring bad formats. The only weirdy is that the default format is A17, and this applies to other functions, not just SUBSTR.
You could use (as well as .EVAL) -SET &AL = 'A' | &ARGL1;