Skip to main content
Participating Frequently
Aug 27, 2021 4:54 PM UTC

HMAC function

Hi everyone

I'm trying to use the HMAC function in a BASIC program, but each time I try to compile it, I receive the following message:

000002 result = HMAC("SHA1", "master.key", "20210827", 1)
^
',' unexpected, Was expecting: '!', ')', '=', "AND", "OR", "LT", "LE",
"GT", "GE", "NE", "EQ", "MATCH"
Array 'HMAC' never dimensioned.

2 Errors detected, No Object Code Produced.

Anybody can help?

Thank you.

------------------------------
Osvaldo Djivelekian
Senior Developer
Rocket Forum Shared Account
------------------------------

    4 replies

    Neil Morris
    Rocketeer
    Aug 30, 2021 9:30 AM UTC
    Hi everyone

    I'm trying to use the HMAC function in a BASIC program, but each time I try to compile it, I receive the following message:

    000002 result = HMAC("SHA1", "master.key", "20210827", 1)
    ^
    ',' unexpected, Was expecting: '!', ')', '=', "AND", "OR", "LT", "LE",
    "GT", "GE", "NE", "EQ", "MATCH"
    Array 'HMAC' never dimensioned.

    2 Errors detected, No Object Code Produced.

    Anybody can help?

    Thank you.

    ------------------------------
    Osvaldo Djivelekian
    Senior Developer
    Rocket Forum Shared Account
    ------------------------------
    Hi Osvaldo,
    Are you running with UniData or UniVerse? And which version of the product? The error message you are getting is an indication the compiler is not recognizing the HMAC() function and therefore is treating it as a dimensioned array. I just did a quick test with UniVerse using your example and it does work.

    >COPYP BP HMAC (TSN

    HMAC
    RESULT = HMAC("SHA1","MASTER.KEY","20210827",1)
    CRT RESULT
    END
    >BASIC BP HMAC
    Compiling: Source = 'BP/HMAC', Object = 'BP.O/HMAC'


    Compilation Complete.

    Neil

    ------------------------------
    Neil Morris
    Universe Advanced Technical Support
    Rocket Software
    ------------------------------
    Participating Frequently
    Aug 30, 2021 9:46 AM UTC
    Hi Osvaldo,
    Are you running with UniData or UniVerse? And which version of the product? The error message you are getting is an indication the compiler is not recognizing the HMAC() function and therefore is treating it as a dimensioned array. I just did a quick test with UniVerse using your example and it does work.

    >COPYP BP HMAC (TSN

    HMAC
    RESULT = HMAC("SHA1","MASTER.KEY","20210827",1)
    CRT RESULT
    END
    >BASIC BP HMAC
    Compiling: Source = 'BP/HMAC', Object = 'BP.O/HMAC'


    Compilation Complete.

    Neil

    ------------------------------
    Neil Morris
    Universe Advanced Technical Support
    Rocket Software
    ------------------------------
    Hi Neil.

    I am running Universe version 11.2.0 - Pick Format

    Thanks
    Neil Morris
    Rocketeer
    Aug 30, 2021 10:00 AM UTC
    Hi Neil.

    I am running Universe version 11.2.0 - Pick Format

    Thanks
    Hi Osvaldo,
    The HMAC() function in BASIC does not exist at the 11.2.0 release of UniVerse. It was added to UniVerse at the 11.3.1 Release.
    This is why you are getting the compiler error when attempting to use it at 11.2.0.
    Note, the functionality was also included in the 11.2.5.4815 controlled release.
    You will need to upgrade to a more current version to use the HMAC() functionality.
    Hope that helps.
    Thanks,
    Neil

    ------------------------------
    Neil Morris
    Universe Advanced Technical Support
    Rocket Software
    ------------------------------
    Participating Frequently
    Aug 30, 2021 10:04 AM UTC
    Hi Osvaldo,
    The HMAC() function in BASIC does not exist at the 11.2.0 release of UniVerse. It was added to UniVerse at the 11.3.1 Release.
    This is why you are getting the compiler error when attempting to use it at 11.2.0.
    Note, the functionality was also included in the 11.2.5.4815 controlled release.
    You will need to upgrade to a more current version to use the HMAC() functionality.
    Hope that helps.
    Thanks,
    Neil

    ------------------------------
    Neil Morris
    Universe Advanced Technical Support
    Rocket Software
    ------------------------------
    Thank you very much for your answer, Neil.

    Regards.
    Osvaldo.