Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
rsm_deepak

New User


Joined: 06 Apr 2005
Posts: 31
Location: visakhapatnam

PostPosted: Tue Jul 21, 2009 12:12 pm    Post subject: move a X(56) to b X(75) will the last 19 bytes have spaces
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

Site Director


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

PostPosted: Tue Jul 21, 2009 9:17 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us