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

Move 2 byte to 1byte & 1 byte to 2 byte


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 Jun 22, 2010 10:16 am
Reply with quote

Can anyone suggest me the following problem:

System C complaining that a field of 2 bytes - 9(2) is not getting populated. After researching I came to know I have to move a variable from Ssytem A -> B -> C.

System A & C is having 2 bytes which is 9(2)
But the System B is having only 1 byte filler. There is no possibility that I can increase a space in system B.

So can I store a 2 byte value in system B with 1 byte &
then move the 1 byte value from B to system C which is of 2 bytes.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jun 22, 2010 12:47 pm
Reply with quote

not directly, but indirectly.

you can not define 1 byte a packed-decimal.

you need an intermediate field pic 9(4) comp (2 bytes)
and using redefines, access the last byte and move it using pic x(1).
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Tue Jun 22, 2010 4:31 pm
Reply with quote

will a packed decimal with value 15 not look like x'015F' or x'015C'
so the last byte would be x'5F' ?

you need to multiply by 10 and take the frst byte, i guess.

or take a Binary halfword s9(4) comp and take the last byte.

and better make sure, you don't pass any EBCDIC/ASCII/UNICODE conversion .
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 Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
Search our Forums:

Back to Top