Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
rajesh_mbt

New User

Joined: 27 Mar 2006
Posts: 95
Location: India

 Posted: Mon Dec 11, 2006 5:18 pm    Post subject: What is the result of the below code? 01 A PIC S9(3). MOVE -125 TO A. DISPLAY A. What is the value of A?

krisprems

Active Member

Joined: 27 Nov 2006
Posts: 649
Location: India

 Posted: Mon Dec 11, 2006 5:28 pm    Post subject: 12N will be displayed
rajesh_mbt

New User

Joined: 27 Mar 2006
Posts: 95
Location: India

 Posted: Mon Dec 11, 2006 5:31 pm    Post subject: Re: What is the result of the below code? Thanks for your reply. Can you help me how it becomes 12N.
krisprems

Active Member

Joined: 27 Nov 2006
Posts: 649
Location: India

 Posted: Mon Dec 11, 2006 5:38 pm    Post subject: The sign will be punched on the least significant bit. The corresponding codes for the positive and negetive digits are as follows.... if the no. is positive and the ... last digit is | corresponding value is 1 | A 2 | B 3 | C 4 | D 5 | E 6 | F 7 | G 8 | H 9 | I RESPECTIVELY if the no. is negetive and the ... last digit is | corresponding value is 1 | J 2 | K 3 | L 4 | M 5 | N 6 | O 7 | P 8 | Q 9 | R
karthick Raja

New User

Joined: 10 Aug 2006
Posts: 8

 Posted: Mon Dec 11, 2006 6:09 pm    Post subject: Re: What is the result of the below code? Hi, Just put HEX ON and you can note the value suppressed. (Lease Significant Bit + Sign).
muthukannan

New User

Joined: 03 Aug 2006
Posts: 42
Location: Chennai

 Posted: Tue Dec 12, 2006 8:51 am    Post subject: Re: What is the result of the below code? Hi, If we are declaring s9(4) , its displaying the same value. How to display the 123 with a minus symbol or 123N? Can you please explain about this. Thank you, MK
priyesh.agrawal

Senior Member

Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

Posted: Tue Dec 12, 2006 9:49 am    Post subject: Re: What is the result of the below code?

 Quote: How to display the 123 with a minus symbol or 123N?

Declare it as PIC ---9.
cobolunni

Active User

Joined: 07 Aug 2006
Posts: 128
Location: kerala,india

 Posted: Tue Dec 12, 2006 10:48 am    Post subject: You can also declare variable as PIC S9(3) SIGN IS LEADING SEPARATE.
h.dinesh

New User

Joined: 06 Dec 2006
Posts: 46
Location: Chennai

 Posted: Tue Dec 12, 2006 6:30 pm    Post subject: Re: What is the result of the below code? Hi, Just to add to above PIC S9(4) SIGN LEADING SEPARATE --- displays sign in the beginning you may also use PIC S9(4) SIGN TRAILING SEPARATE --- displays sign at end Dinesh
muthukannan

New User

Joined: 03 Aug 2006
Posts: 42
Location: Chennai

 Posted: Wed Dec 13, 2006 12:03 pm    Post subject: Re: What is the result of the below code? Hi Guys, Thank you so much for the elaborated explanasions. Thank you, MK
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Speed-up/reduce CPU use of code prino PL/I & Assembler 0 Tue Sep 26, 2017 12:05 am how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us