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

Author Message
Sumeendar

New User

Joined: 31 Jan 2006
Posts: 39

 Posted: Fri Apr 13, 2012 5:37 pm    Post subject: Equivalent decimal value for Comp-4 Binary value 158 Hi Kindly let me know the equivalent decimal value for Comp-4 Binary value 158. Thanks

Bill Woodger

DFSORT Moderator

Joined: 09 Mar 2011
Posts: 7314

 Posted: Fri Apr 13, 2012 5:46 pm    Post subject: Reply to: Equivalent decimal value for Comp-4 Binary value 1 Same as in COMP.
Sumeendar

New User

Joined: 31 Jan 2006
Posts: 39

 Posted: Fri Apr 13, 2012 5:53 pm    Post subject: Reply to: Equivalent decimal value for Comp-4 Binary value 1 Is decimal value 344 equivalent to COMP-4 binary value 158.
Robert Sample

Global Moderator

Joined: 06 Jun 2008
Posts: 8200
Location: East Dubuque, Illinois, USA

 Posted: Fri Apr 13, 2012 6:04 pm    Post subject: No, decimal 158 is equivalent to COMP-4 binary value 158 -- the form of the number will not change the value. Hexadecimal value x'0158' has the value of 344 in decimal -- the representation of the number will determine the hexadecimal characters used to identify the value, but the value won't change.
Bill Woodger

DFSORT Moderator

Joined: 09 Mar 2011
Posts: 7314

 Posted: Fri Apr 13, 2012 6:11 pm    Post subject: Reply to: Equivalent decimal value for Comp-4 Binary value 1 These days there are even PCs with calculators. Either "scientifc" or "programming". The way we did it was just to learn base 16 maths. As an aid there was the old green/yellow card. You have one 256, five 16s and eight. Add 'em all up. If you practice it, it'll work when you don't have ready access to a calculator and won't interrupt the "flow" of dump-reading/disk/tape viewing etc. Or you can ask on a forum and take the knocks.
Sumeendar

New User

Joined: 31 Jan 2006
Posts: 39

 Posted: Mon Apr 16, 2012 2:20 pm    Post subject: Reply to: Equivalent decimal value for Comp-4 Binary value 1 I have a binary value (pic 9(4) comp-4 type), with hex on gives 0135 . I tried to convert this binary value to zoned decimal for display purpose using the below build function BUILD=(1:51,2,BI,ZDF,LENGTH=4) After the execution i got the zoned decimal value as 0309. Please let me know if this is correct.
Bill Woodger

DFSORT Moderator

Joined: 09 Mar 2011
Posts: 7314

Posted: Mon Apr 16, 2012 2:25 pm    Post subject: Reply to: Equivalent decimal value for Comp-4 Binary value 1

That would be one 256, three 16s and five.

Have you not even found the calculator?

At least you found DFSORT.

EDIT: There has to be something deeper here, doesn't there?

 Code: 01  a-group.     05  a-comp-4 comp-4 pic 9(4) value 309. DISPLAY ">" a-group "<>" a-comp-4 "<"

Put it in a program. Compile, run. SET HEX ON for the output. You gave it 309, it gave you back 135 (from the hex display) and 309.
enrico-sorichetti

Global Moderator

Joined: 14 Mar 2007
Posts: 10374
Location: italy

Posted: Mon Apr 16, 2012 2:30 pm    Post subject: Reply to: Equivalent decimal value for Comp-4 Binary value 1

is it so difficult to find out Yourself...
if it is so a career change is strongly suggested

don' t You have an hex/dec calculator ?
all the windoze systems have one

or just try to remember Your basic maths and ...

 Code: 1 * 256 ==> 256 + 3 *  16 ==>  48 + 5 *   1 ==>   5 = --------------------         ==> 309
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am

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