aboutsummaryrefslogtreecommitdiff
path: root/gcc/cobol/udf/stored-char-length.cbl
blob: 66889d021e6d946076ff742f2a179045c96fb4b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
        >> PUSH source format
        >>SOURCE format is fixed

      *  This function is in public domain.
      *  Contributed by James K. Lowden of Cobolworx in August 2024

        Identification Division.
        Function-ID. STORED-CHAR-LENGTH.
        Data Division.
        Linkage Section.
        01 Candidate PIC X Any Length.
        77 Output-Value    PIC 9(8) COMP-5.
        
        Procedure Division using Candidate RETURNING Output-Value.
          Move Function Length( Function Trim(Candidate) )
            to Output-Value. 
        End Function STORED-CHAR-LENGTH.

        >> pop source format