× 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.



Hi

Thanks to Luis Buck and Jim on your replies for AS400 access.
Mark Waterbury set me up and I am slowly weeding out the bugs.

A PF can have B (binary) fields and I have managed to update them, but I have a question.
I needed to convert the numeric values on the display back to B on update.
I checked the archives but I cant find an answer, maybe my age showing.
I cant find any function that will do the cvt except for %bin in CL.
I coded this routine and it is working but limited to 15 character numerics.

Any suggestions welcome, but I am not sure I need the arithmetic base conversion calculator.

/* NUMERIC TO BINARY CONVERTER  */


PGM (&NUM  &BIN2  &BIN4 &BINTYP  )

DCL  VAR(&NUM) TYPE(*DEC) LEN(15 0)
DCL VAR(&BINTYP) TYPE(*CHAR) LEN(1)
DCL VAR(&BIN2) TYPE(*CHAR) LEN(2)
DCL VAR(&BIN4) TYPE(*CHAR) LEN(4)

IF (&BINTYP = '4') (CHGVAR %BIN(&BIN4) &NUM)
IF (&BINTYP = '2') (CHGVAR %BIN(&BIN2) &NUM)
ENDPGM

Frank Kolmann

>On 24/11/2018 12:00 AM, Luis Rodriguez wrote:
>Frank,
>
>If you are willing to check until Jan. 2019, check out the PUB400.COM site.
>
>HTH,
>
>Luis Rodriguez

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.