Page 1 of 1

String function

PostPosted: Wed Feb 23, 2011 5:07 pm
by sriraj1122
Hi ,

I need a small help regarding string function in Cobol

01 TEMP-VAR                       PIC X(50)         
                                    VALUE     SPACE.       
01 SOURCE-CD                                         
                        PIC X(2)                           
                        VALUE SPACES.                     
01 FULL-DESC           PIC X(55)             
                          VALUE     SPACE.                 
PROCEDURE DIVISION.                                       
    MOVE 'FAIR CREDIT REPORTING ACT NOTICE/CL'             
    TO   TEMP-VAR.                                   
    MOVE 'CS' TO SOURCE-CD.                         
          STRING TEMP-VAR  DELIMITED BY SIZE         
                 '/' SOURCE-CD DELIMITED BY SIZE     
                 INTO FULL-DESC             
          END-STRING.                                     
        DISPLAY FULL-DESC.


In the final output FULL-DESC i should get the out as below

FAIR CREDIT REPORTING ACT NOTICE/CL/CS

But with the above code im getting like below
FAIR CREDIT REPORTING ACT NOTICE/CL

Pls help me

Re: String function

PostPosted: Wed Feb 23, 2011 6:08 pm
by enrico-sorichetti
the TS has already been advised not to double post!
he has already received a very good answer from Dick (dbzTHEdinosauer) on the other forum!