As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at firstname.lastname@example.org and provide your corporate email address, company, and name.
One way is to use the function in a relational database. Here I use HASHBYTES in SQL Server:
-SET &SECURITY_STRING = 'HI THERE'; ENGINE SQLMSS SET DEFAULT_CONNECTION bob SQL SQLMSS PREPARE SQLOUT FOR SELECT HASHBYTES ('MD5','&SECURITY_STRING') AS SECURITY_TOKEN END TABLE FILE SQLOUT PRINT SECURITY_TOKEN END
The new FOCUS functions CHECKMD5 and CHECKSUM were added starting from the release 7.7.07. The CHECKMD5 function accepts Alpha variable for the input parameter and returns A16 which contains 128 bit hash index. Example: DEFINE FILE ibisamp/car MD5_FIELD/A32 MISSING ON = HEXTYPE(CHECKMD5( CAR )); END TABLE FILE IBISAMP/CAR PRINT CAR COUNTRY MD5_FIELD END -RUN
The CHECKSUM function accepts Alpha variable for the input parameter and returns I11 that contains 32 bit hash index. Example: DEFINE FILE ibisamp/car CHKSUM_FIELD/I11 MISSING ON = CHECKSUM( CAR ); END TABLE FILE IBISAMP/CAR PRINT CAR COUNTRY CHKSUM_FIELD END -RUN