Midrange News for the IBM i Community

Posted by: George Fuste
IBM i developer
Jacksonville, FL
%TRIML and %SUBST with a blank field
has no ratings.
Published: 07 Sep 2016
Revised: 08 Sep 2016 - 706 days ago
Last viewed on: 15 Aug 2018 (1317 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

%TRIML and %SUBST with a blank field Published by: George Fuste on 07 Sep 2016 view comments(3)

DTxt              s           1024    inz   
DTxtOut           s             15    inz   
    TxtOut = %subst(%TrimL(Txt):1:15);      

The test program fails on the %subst operation.
RNX0100- Length or start position is out of range for the string operation.

I've never seen this before but is this because all
blanks are removed and the "Txt" field is null or maybe has no point of reference for value?                                

Return to midrangenews.com home page.
Sort Ascend | Descend