× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



A two byte binary decimal field holds 4 digits, -9999 to 9999.
bindec(4:0)

However, you really shouldn't be using bindec() in RPG IV when you have
zero decimal places
DDS binary fields are actually true integer fields, a two byte DDS Binary
will hold -32768 to 32767

Thus int(5) is the better choice for RPG IV.

And note that if you actually have binary fields with zero decimal places
in a DDS defined file on the f-spec you'd want to include
ctl-opt extinct(*YES)

HTH,
Charles



On Fri, Oct 13, 2023 at 7:38 AM Robert Wenzel <robert.wenzel@xxxxxxxxx>
wrote:

If I want to convert this data structure from d-specs to free-form, which
of the examples, below, would be correct? I am having trouble with what
the Fixed Binary subfield should be; bindec() or int() and its length.

D FIDS01 DS
D STCSRP 370 371B 0
D SFPAGE 378 379B 0

==== Example #1 ====
dcl-ds FIDS01 ;
STCSRP bindec(4:0) pos(370) ;
SFPAGE bindec(4:0) pos(378) ;
end-ds;

==== Example #2 ====
dcl-ds FIDS01 ;
STCSRP bindec(9:0) pos(370) ;
SFPAGE bindec(9:0) pos(378) ;
end-ds;

==== Example #3 ====
dcl-ds FIDS01 ;
STCSRP int(10) pos(370) ;
SFPAGE int(10) pos(378) ;
end-ds;

Thank you
--

*Robert Wenzel, Senior Software Engineer*
iSeries Applications Support and Development

[image: Inmar]
<
https://www.inmar.com/?utm_source=email%20signature&utm_medium=email&utm_campaign=Associate%20Email%20Signature&utm_content=Inmar%20Logo



robert.wenzel@xxxxxxxxx

One West Fourth Street, Suite 500, Winston Salem, NC 27101
*p: 336-770-3478*
www.inmar.com
<
https://www.inmar.com/?utm_source=email%20signature&utm_medium=email&utm_campaign=Associate%20Email%20Signature&utm_content=URL%20link

| LinkedIn <https://www.linkedin.com/company/inmar> | Facebook
<https://www.facebook.com/inmarinc> | Twitter
<https://twitter.com/inmarinc>

"The whole problem with the world is that fools and fanatics are always so
certain of themselves, but wiser people so full of doubt." - Bertrand
Russell

--


********************************************





*Inmar Confidentiality
Note*: This e-mail and any attachments are confidential and intended to
be
viewed and used solely by the intended recipient. If you are not the
intended recipient, be aware that any disclosure, dissemination,
distribution, copying or use of this e-mail or any attachment is
prohibited. If you received this e-mail in error, please notify us
immediately by returning it to the sender and delete this copy and all
attachments from your system and destroy any printed copies. Thank you
for
your cooperation.





*Notice of Protected Rights*: The removal of any
copyright, trademark, or proprietary legend contained in this e-mail or
any
attachment is prohibited without the express, written permission of Inmar,
Inc. Furthermore, the intended recipient must maintain all copyright
notices, trademarks, and proprietary legends within this e-mail and any
attachments in their original form and location if the e-mail or any
attachments are reproduced, printed or distributed.



********************************************
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.