IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

move a X(56) to b X(75) will the last 19 bytes have spaces


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rsm_deepak

New User


Joined: 06 Apr 2005
Posts: 30
Location: visakhapatnam

PostPosted: Tue Jul 21, 2009 12:12 pm
Reply with quote

************************************************

There is a field from database which is
ABC-250 PIC X(75).
and having the value 'XXXXXXXXXXXXXXXXXX' in the last 19 bytes.


Now I doesn't want to have 'XXXXXXXXXXXXXXXXXX' in the last 19 bytes.

************************************************


So I declare

01 WS-ABC-250.
05 WS-ABC-250-ACTUAL PIC X(56) VALUE SPACES.
05 WS-ABC-250-ABND-MSG PIC X(19) VALUE
'XXXXXXXXXXXXXXXXXX'.


MOVE ABC-250 TO WS-ABC-250.
MOVE WS-ABC-250-ACTUAL TO ABC-250.

Surprisingly I didn't get 'XXXXXXXXXXXXXXXXXX' in ABC-250.

So even without moving spaces to WS-ABC-250-ABND-MSG
I am not getting 'XXXXXXXXXXXXXXXXXX' . This was tested many a times.

My question is when moving a 56 byte to 75 byte(as stated from the above situation) will the last 19 byte will be overidden as spaces or not?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jul 21, 2009 9:17 pm
Reply with quote

Hello,

At the top of the page is a link to "IBM Manuals". Among them are multiple COBOL Language Reference manuals. Pick the one your system uses.

Suggest you look up the operation of a MOVE statement.

Quote:
Surprisingly I didn't get 'XXXXXXXXXXXXXXXXXX' in ABC-250.
Should be No Surprise.

The spaces are correct. . . .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Cobol program with sequence number ra... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
Search our Forums:

Back to Top