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 s9(5) to 9(5) in COBOL

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

New User


Joined: 05 Dec 2005
Posts: 79

PostPosted: Sat May 24, 2008 5:00 pm    Post subject: Move s9(5) to 9(5) in COBOL
Reply with quote

Hi,

i have declaration like

Var1 pic s9(5) value +12345
Var2 pic 9(5).

move var1 to var2.

What will be the value in Var2. I have a doubt whether s9(5) occupies 5 bytes or 6 bytes. pls help
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sat May 24, 2008 5:47 pm    Post subject: Re: Move s9(5) to 9(5)
Reply with quote

Prabha wrote:
What will be the value in Var2.
The same value except the sign nibble will be forced to "F" instead of the original "C"...
Quote:
I have a doubt whether s9(5) occupies 5 bytes or 6 bytes. pls help
Why, because of the "+"?
The sign is stored in the front nibble of the last digit.
var1 is X'F1F2F3F4C5'
var2 is X'F1F2F3F4F5' after the move
Back to top
View user's profile Send private message
Prabha
Warnings : 2

New User


Joined: 05 Dec 2005
Posts: 79

PostPosted: Sun May 25, 2008 7:38 pm    Post subject: Reply to: Move s9(5) to 9(5) in COBOL
Reply with quote

Thank for yr help!!

IF it - (minus) also, C will b changed to F??

Pls let me know s9(5) occupies how many bytes??
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sun May 25, 2008 7:56 pm    Post subject: Re: Reply to: Move s9(5) to 9(5) in COBOL
Reply with quote

Prabha wrote:
IF it - (minus) also, C will b changed to F??
If it is negative, the D will be changed to F.
X'F1F2F3F4D5' to X'F1F2F3F4F5'
Quote:
Pls let me know s9(5) occupies how many bytes??

s9(5) is five bytes.
9(5) is five bytes.
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 XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm


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