String function



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

String function

Postby sriraj1122 » Wed Feb 23, 2011 5:07 pm

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
sriraj1122
 
Posts: 19
Joined: Thu Nov 18, 2010 10:04 am
Has thanked: 0 time
Been thanked: 0 time

Re: String function

Postby enrico-sorichetti » Wed Feb 23, 2011 6:08 pm

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!
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post