Understanding token numbers in xa records
Download
1 / 18

Understanding Token Numbers in XA Records - PowerPoint PPT Presentation


  • 89 Views
  • Uploaded on

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

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Understanding Token Numbers in XA Records' - priscilla-mays


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Understanding token numbers in xa records

Understanding Token Numbers in XA Records

Tuesday, August 11, 2009

Presenter: Charles Hood, CISTECH, Inc.


Overview
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


Purpose of xa token fields
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


Xa files which use a token field 1
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


Xa files which use a token field 2
XA Files which use a Token Field (2)

6. SLQNTY

7. MOTRAN

8. ITMPRC

9. OPENAR

10. ARHSTS

11. PURACT


Data elements packed into a token 1
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


Data elements packed into a token 2
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


Data elements packed into a token 3
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#)


Calling the token generator api 1
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


Calling the token generator api 2
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


Calling the token generator api 3
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


Two gotchas 1
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


Two gotchas 2
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


Potential duplicates
“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


Special r7 consideration 1
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


Special r7 consideration 2
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


Special r7 consideration 3
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


Thank you charles hood charles hood@cistech net

THANK YOU!

Charles Hood

[email protected]


ad