1 / 18

Understanding Token Numbers in XA Records

Understanding Token Numbers in XA Records. Tuesday, August 11, 2009 Presenter: Charles Hood, CISTECH, Inc. Overview. Purpose of XA Token Fields XA Files which use a Token Field Data Elements packed into a Token Calling the Token-Generator API Two “Gotchas”! “Potential” Duplicates

leev
Download Presentation

Understanding Token Numbers in XA Records

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Understanding Token Numbers in XA Records Tuesday, August 11, 2009 Presenter: Charles Hood, CISTECH, Inc.

  2. Overview • Purpose of XA Token Fields • XA Files which use a Token Field • Data Elements packed into a Token • Calling the Token-Generator API • Two “Gotchas”! • “Potential” Duplicates • Special R7 Consideration

  3. Purpose of XA Token Fields • To ensure that XA applications are able to obtain unique key access to application data that is not necessarily unique • Typically, master files have application data which ensures unique key access, but transaction files may not

  4. XA Files which use a Token Field (1) • Current list (subject to change in future releases) • MOMAST (token used in REP Schedules) • IMHIST • INVTXN • PCCTXN • OEITXN

  5. XA Files which use a Token Field (2) 6. SLQNTY 7. MOTRAN 8. ITMPRC 9. OPENAR 10. ARHSTS 11. PURACT

  6. Data Elements Packed into a Token (1) • Token fields are 15 character, alphanumeric • The “characters” in a Token field are hexadecimal values comprised of the following: • Date/Time • Sequence Number • System Job Number

  7. Data Elements Packed into a Token (2) • More detail: • Date/Time is 13 digits packed into 7 positions • Sequence Number is 7 digits packed into 4 positions • System Job Number is 6 digits packed into 4 positions

  8. Data Elements Packed into a Token (3) • Sample token from an ITMPRC record: ØbÉdè| jß| (Value in file) 0887854 0001 0954 002144F 000F 019F (Dt/Tm) (Seq#)(Job#)

  9. Calling the Token-Generator API (1) • API Program AMVLN generates tokens to uniquely identify records • A call to AMVLN requires four parameters: • (I) Shutdown/process 8 chars • (O) Unique key token 15 chars • (O) Message ID 7 chars • (O) Message data 512 chars

  10. Calling the Token-Generator API (2) • Expected Values for the “Shutdown/process” Input Paramter: • *PRC = Process with no program shutdown • *PRC_SHT = Process and shutdown • *SHT = No processing, just shutdown program

  11. Calling the Token-Generator API (3) • Sample Call to AMVLN: C* CALL TOKEN GENERATOR PGM FOR TOKEN FOR SLQNTY C* C CLEARTKEN C CALL 'AMVLN' C PARM '*PRC 'SHD$P 8 C TKEN PARM *BLANKS TKEN$P 15 C PARM *BLANKS MGID$P 7 C PARM *BLANKS MGDT1P C* C WRITESLQNTYSQ

  12. Two “Gotchas”! (1) • First “Gotcha” is due to the ability of modern fast iSeries processors to process a high volume of transactions. • When a U-job was ended and restarted within one second, duplicate tokens were generated because the sequence # was not saved. • This was resolved with a Program fix: XAR6 PTF 6943 XAR7 PTF 3640

  13. Two “Gotchas”! (2) • Second “Gotcha” can occur when the iSeries system time is reset (DST, Sync with Atomic Clock, etc.) • When resetting the system time, be careful! • All U-jobs must be ended • HLDJOBQ to prevent U-jobs starting • Get a Dedicated XA system • The post backup procedure is the best place for nightly updating the system time

  14. “Potential” Duplicates • Currently, AMVLN could generate duplicate Tokens after one century of use • “Older” AMVLN could generate a duplicate key if system processing speed improves to the point that 9,999,999 records can be added to a file in one second • “Newer” AMVLN includes the millisecond value in the Sequence Number portion – a theoretical possibility of duplicates still exists

  15. Special R7 Consideration (1) • In most XA files which use tokens as key fields, the token field is 15 characters alphanumeric; in the R7 integrator, however, the token field is 30 characters, with a subtype of “Hex” • When a Business Object user exit is activated which uses a file containing a token field as a key field (like Item Location, which uses the SLQNTYL4 logical), the token comes into the user exit program as a 30 character alphanumeric field

  16. Special R7 Consideration (2) • XA provides an API program PSVCHS1R which will convert a “Hex” field to its alphanumeric equivalent • A call to PSVCHS1R requires five parameters: • (I) Perform process? 8 chars • (I) Shutdown program? 8 chars • (I) Hexadecimal value 128 chars • (O) Character value 64 chars • (O) Message ID 7 chars

  17. Special R7 Consideration (3) • Sample Call to PSVCHS1R : * - P#HXVL Value must be in X’cccc’ format c Eval p#HXVL = ‘X’’’ + uTKENLQ + ‘’’’ c Call ‘PSVCHS1R' c Parm ‘*YES’ P#PFPR 8 c Parm ‘*NO’ P#SHDN 8 c Parm P#HXVL 128 c Parm *blanks P#CHVL 64 c Parm *blanks P#MSID 7 * c Movel p#chvl keyfld 15 c slqnkey Chain SLQTNYL4

  18. THANK YOU! Charles Hood Charles.hood@cistech.net

More Related