MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Question on string statement

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
vijay
Beginner


Joined: 09 May 2003
Posts: 131
Topics: 64

PostPosted: Mon Jun 09, 2008 12:31 pm    Post subject: Question on string statement Reply with quote

Hi ,
Need help with small logic.Here is the code
01 TEST-DATA.
05 ws-text PIC X(05) VALUE 'temp'.
05 ws-output PIC X(50).

EJECT

PROCEDURE DIVISION.

move 'xxxx - temp' to ws-output


STRING ws-text
ws-output (1:6)
DELIMITED BY SIZE
INTO ws-output.
display ws-output.


GOBACK.


Why is the ouput 'temp temp t ' ? If i change INTO ws-output to another variable WS-OUTPUT1 it works fine.Anyone help what is the reason behind this>?
Back to top
View user's profile Send private message
jsharon1248
Intermediate


Joined: 08 Aug 2007
Posts: 291
Topics: 2
Location: Chicago

PostPosted: Mon Jun 09, 2008 1:51 pm    Post subject: Reply with quote

Why are you using the WS-OUTPUT field as the source and target? Based on the values, COBOL is doing what I would expect. The compiler replaces the STRING with a series of MOVEs, so the results make sense. If you're really trying to prefix WS-OUTPUT with the value in WS-TEXT, define the fields as part of a group, or string the fields into a different target.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group