IBM Z and LinuxONE Software

Software

Software

In order to compete you have to be trusted. System software delivers high-performing system and database management, faster insights, secure cloud and agile DevOps, plus the reliability, flexibility and protection you expect from the mainframe.

 View Only
  • 1.  File Manager for z/OS Version 15 Release 1 Modification 5

    Posted Thu August 15, 2024 06:05 PM

    Hi, 

    I am trying to use the REXX X2D function.  It does not seem to work when a variable is specified but is okay with a literal value.

    IBM File Manager for z/OS
    FMNBC514 REXX procedure statements read from SYSIN.

    *REXXPROC
         aix_key_len = substr(inrec,5,1)
         aix_key_len = X2D(aix_key_len)
    say 'AIX Key Length' aix_key_len
    call find_dat
    do while down(1) /= "EOF"
       call find_dat
    end
    find_dat:
       if substr(inrec,6,25) == 'RAMBO                   J' then
          say 'inrec 'recsin()' 'substr(inrec,120000,25)
    return 0

    FMNBB060 REXX procedure statements processed by REXX.
         4 +++ aix_key_len = X2D(aix_key_len)
    IRX0040I Error running FMNINTEX, line 4: Incorrect call to routine
    FMNBB382 REXX exec terminated with RC 20040

    IBM File Manager for z/OS
    FMNBC514 REXX procedure statements read from SYSIN.

    *REXXPROC
         aix_key_len = substr(inrec,5,1)
         aix_key_len = X2D('19')
    say 'AIX Key Length' aix_key_len
    call find_dat
    do while down(1) /= "EOF"
       call find_dat
    end
    find_dat:
       if substr(inrec,6,25) == 'RAMBO                   J' then
          say 'inrec 'recsin()' 'substr(inrec,120000,25)
    return 0

    FMNBB060 REXX procedure statements processed by REXX.
    AIX Key Length 25
    inrec 41242  99242168500006 992421685



    ------------------------------
    Girish Sajja
    ------------------------------


  • 2.  RE: File Manager for z/OS Version 15 Release 1 Modification 5
    Best Answer

    Posted Sun August 18, 2024 09:18 PM

    This is a REXX coding issue.

    aix_key_len = substr(inrec,5,1)
    aix_key_len = C2D(aix_key_len)

    X2D presumes hexadecimal display value - which it cannot be since it is 1 byte long.

    If its a binary 1 length then it should be C2D.

    Regards

    Tyrone Dalais

    FM Development



    ------------------------------
    Tyrone Dalais
    ------------------------------



  • 3.  RE: File Manager for z/OS Version 15 Release 1 Modification 5

    Posted Tue August 20, 2024 12:41 PM

    The REXX X2D(bla bla) requires that aix_key_len has a display hexadecimal value - which it cannot have if  you issue aix_key_len = substr(inrec,5,1) as that is only 1 character and its highly unlikely the length is in display hexdecimal format. The inrec you display has a '2' in the 5th byte (not binary - but display). If its a binary length then the REXX function should be C2D not X2D - but I would think you need to ensure the value set in aix_key_len is at the correct offset.

    Tyrone

    FM   



    ------------------------------
    Tyrone Dalais
    ------------------------------



  • 4.  RE: File Manager for z/OS Version 15 Release 1 Modification 5

    Posted Tue August 20, 2024 01:25 PM

    Hi,

    try to use an input string with a length of 2 for a valid hexstring.
    Regards, Nicole



    ------------------------------
    Nicole Niederführ
    ------------------------------