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 RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 5 Wed Mar 29, 2017 12:47 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm


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