ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

RPGLE/SQL with FTRANS

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • RPGLE/SQL with FTRANS

    Hi all,

    we have a file that uses file translation across multiple different environments (the translation table is the same across all environments) but the record format is not consistent. For example:

    ENV1_LIB/FILE1 (Format: XXXZZZ111RRRR)
    ENV2_LIB/FILE1 (Format: XXXZZZ111RRRR)
    ENV3_LIB/FILE1 (Format: XXXZZZ111RRR0)

    My program is an overarching service that maintains 4 key fields on this file. The 4 fields I want to look at are always present but because the record format is different I can't declare it like a normal file in the RPG program because it will level check - therefore the decision to use SQL has been made.

    In the RPG programs that read/write to this file the file translation is declared in **FTRANS compile time data segment. If I still include this in my program will the SQL pickup the file translation?

  • #2
    I'm not familiar with **FTRANS / File Translation. What is it?

    Comment


    • #3
      File translation table is basically an automatic %XLATE. If you have a variable you can move it into the field of a file (that has a translation table definition) and it will automatically translate it.

      Taken from the IBM RPGLE help:
      The FTRANS keyword specifies whether file translation will occur. If specified, optionally with *SRC, file translation will take place and the translate table must be specified in the program. If not specified or specified with *NONE, no file translation will take place and the translate table must not be present.

      Here are some links:


      Comment


      • #4
        FTRANS is only used by RPG's native file access. SQL will not do anything with it.

        I think that what might work for SQL is "field procedures", which enable column-level encryption. https://www.ibm.com/support/knowledg...fieldprocs.htm

        This page has an example of a field procedure program: https://www.ibm.com/support/knowledg...yfpexample.htm

        Comment


        • #5
          Thanks for the reply Barbara was pretty sure that would be the case. The links were really helpful

          Comment

          Working...
          X