SCT Translation Utility

Standard Method

There is a need to be able to translate values using the SCT DBD dictionary. This utility will do those translations. While it is probably not the simplest way, it has performance considerations. If a program is to do several thousand translations, this method will be much more efficient than the short method.

The module to use is SCTLKUP. It uses 7 arguments, the first two being constants. These seven arguments are:

  1. System Number (e.g., '001' for SIS, '002' for FRS, '003' for HRS and '005' for LMS)
  2. Element Number (e.g., 'FG054 for FRS Department Code translation)
  3. Action Code (e.g., O to initialize, or open, a translation for an element, T to translate an element and C to close all translation processes.
  4. Link, which is a pointer related to each element to be translated. It is returned when an open is performed for an element. It must be saved and passed appropriately when doing a translation.
  5. Code to be Translated (15 bytes)
  6. Translated Value (50 bytes)
  7. Return Code. "0" is normal. Any other value indicates a problem. The REMARKS section of the Cobol program XSTRAN contains the meaning of these return codes.

Example

A program wants the department name for department codes in the FRS system and the school name for a given school code. FRS is system 002. Department code is element FG054 and school code is element FG052. Several variables need to be defined for code to be translated, translation value and return code. For example:


   HDEPTCD           W           015 A
   HDEPTNAME         W           050 A
   HDEPTLINK         W           004 A
   HSCHLCD           W           015 A
   HSCHLNAME         W           050 A
   HSCHLLINK         W           004 A
   HRTNCD            W           001 a

The sample program code would look something like the following:


  %SCTLKUP '002' 'FG052' 'O' HSCHLLINK HSCHLCD HSCHLNAME HRTNCD
  %SCTLKUP '002' 'FG054' 'O' HDEPTLINK HDEPTCD HDEPTNAME HRTNCD
  HSCHLCD = '60'
  %SCTLKUP '002' 'FG052' 'T' HSCHLLINK HSCHLCD HSCHLNAME HRTNCD
  HDEPTCD = '01311'
  %SCTLKUP '002' 'FG054' 'T' HDEPTLINK HDEPTCD HDEPTNAME HRTNCD

If HRTNCD is 0, then HSCHLNAME and HDEPTNAME will contain the translations of School Code 60 and Department Code 01311, respectively.

JCL Considerations

This routine requires that 2 DD statements be added to your JCL. The first DD statement is always the same, namely:


//DTFILE   DD    DSN=AUP08V.ZSS.xxxx.DTFILE,DISP=SHR

where xxxx is PROD, TEST, INST or INST2, as appropriate.

The second DD statement depends on the SCT system being accessed. It should be:


//XDFNNN   DD    DSN=xxx,DISP=SHR

where xxx is the name of the DBD (XDF) file for the system being accessed. For example, the production version of this file for FRS is AUP02V.ZSS.PROD.XDF002, while the install version for SIS is AUP07V.SIS.INST.XDF001 and is AUP03V.HRS.INST.XDF003 for HRS. For all systems in production, the name is AUP0xV.ZSS.PROD.XDFnnn, where nnn is the SCT system number. The files follow current naming standards (i.e., AUP07V.SIS for SIS, AUP02V.FRS for FRS and AUP03V.HRS for HRS). Note that the DDName is always the same, namely, XDFNNN.

Limitations

One of the biggest limitations here is that translations for only a single system can be done. This is a limitation of the underlying SCT translation program rather than in the Easytrieve Plus implementation. The same DDName is always used, so only a single XDF file can be referenced, limiting translations to that SCT system.

Technical

The SCTLKUP Easytrieve Plus module accesses an underlying Cobol program called SCTTBL1. This, in turn, calls an SCT-supplied module called XSTRAN. The SCT translation process requires that data translations be opened for each element to be translated in order to provide a link to the extracted translations. All opens must be done before any translations can occur. In addition, once all translations are complete, the translation process must be closed or the calling program may abend.

The XSTRAN program accesses the specified XDF file to get element length and translation length. It then accesses the specified DTFILE to do the actual translation.

Return Codes

Return codes are documented in the XSTRAN program source. Valid return codes are:

© 2004;All Rights Reserved