+ Reply to Thread
Results 1 to 2 of 2

Thread: Binary to Decimal conversion

  1. #1

    Default Binary to Decimal conversion

    Hi Simon, I guess you are referring to the 2-byte binary field in position 367 in the file info data structure. Unless you are using the POST opcode somewhere in your program the current line number should always be accessible in that field. By the way, if you are only using it for program internal calculations, there is no need to convert the binary value to decimal. Here is how I would define it in RPG/IV: PrtLinInfo______DS _PlCurLin_______________367___368B_0 Best regards, Carsten

  2. #2
    Guest.Visitor Guest

    Default Binary to Decimal conversion

    This is in the front of the RPG/400 Reference Book. 2.3.1.1 File Dependent Feedback Information Complete file-dependent feedback information is available in the DataManagement Guide. Refer to the section "I/O Feedback Area" and the tables on the file-dependent area in that section. To calculate the From and To positions (positions 44 through 47 and 48through 51 of the input specifications) that specify the subfields of the file-information data structure (INFDS) for the file-dependent area, use the Offset, Data Type, and Length given in the Data Management Guide and do the following calculations: From = 367 + Offset To = From - 1 + Character_Length Character_Length = Length (in bytes) For example, for the relative record number of a subfile record, the Data Management Guide gives: Offset = 9, Data Type is Binary, Length = 2 Therefore, From = 367 + 9 = 376, To = 376 - 1 + 2 = 377. ---------------------------------------------------------------------My Code Example: 0024.00 FSFC202R O E PRINTER OFLIND(*IN99) 0025.00 F INFDS(PTRFDS) 0027.00 D** DEFINE FIELD FOR PRINTER LINE COUNT 0028.00 D PTRFDS DS 0029.00 D PTRLINE 367 368B 0 0293.00 C IF FDSTAT<>'A' 0294.00 C IF PTRLINE > 55 0295.00 C EXSR OVERFLOW 0296.00 C ENDIF

+ Reply to Thread

Similar Threads

  1. Convert Binary Field To Decimal?
    By Guest.Visitor in forum Programming
    Replies: 1
    Last Post: 05-16-2001, 12:33 PM
  2. Is it possible to use OPNQRYF to select using a binary field
    By Guest.Visitor in forum Programming
    Replies: 5
    Last Post: 03-15-2001, 08:26 AM
  3. Character to Decimal conversion errors via CEE4JSTN
    By Guest.Visitor in forum Programming
    Replies: 4
    Last Post: 07-26-2000, 10:05 AM
  4. Binary field compares
    By Guest.Visitor in forum Programming
    Replies: 14
    Last Post: 03-15-2000, 11:29 AM
  5. Binary OR
    By Guest.Visitor in forum Programming
    Replies: 3
    Last Post: 09-08-1999, 12:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts