Define binary variable in RPG free d specs

It is my understanding that below is how you define a binary variable of length 2 in rpg IV D specs.  How do you make the same definition in RPG FREE D SPECS?  

D variableName              S       5i 0

As always thanks ahead for any help.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gary PattersonVP Technology / Senior Consultant Commented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hardrock95Author Commented:
Thanks, Any idea what I may be doing wrong since I cannot find information in this same manual?  Big help today. Thanks again.
The link that Gary provided goes directly to the information. It's not clear how it's possible that you "cannot find" it. Just click the link. When it opens, the navigation pane on the left shows how to locate the information.

However, you almost certainly do not want to use a BINDEC() variable. Those are not exactly equivalent to the fixed-form "5i 0" that you showed in your question. BINDEC() variables would be the equivalent to the old "B" data type that really should never be used unless you are certain you really need it.

Instead, you most likely want the Integer Format. The specification is described in the INT(digits) topic. The example in the documentation shows a maximum 10-digit integer. Your question asks about a 5-digit integer, so you would use:
DCL-S variableName INT(5);

Open in new window

That's about all there is to it.

Gary PattersonVP Technology / Senior Consultant Commented:
Tom's exactly right, of course.  Not sure how I got it in my head that you were looking for "B" type when the question directly asks for "I".  Sorry about the confusion.

Thanks, Tom.
@Gary: No problem. BINDEC() would probably work, but you never know when a future code change could bring a lot of confusion for some maintainer who didn't know what the "B" data type really was, eh?. -- Tom
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IBM System i

From novice to tech pro — start learning today.