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 2 byte to 1byte & 1 byte to 2 byte

 
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 Jun 22, 2010 10:16 am    Post subject: Move 2 byte to 1byte & 1 byte to 2 byte
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    Post subject:
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: 1278
Location: Belgium

PostPosted: Tue Jun 22, 2010 4:31 pm    Post subject:
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    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
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
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm
No new posts Need information on COBOL MOVE CORRES... subratarec COBOL Programming 10 Tue Jun 28, 2016 10:38 pm
No new posts Need Help to Define 36 Input Fields (... satish.ms10 CLIST & REXX 2 Sat May 07, 2016 3:08 pm


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