ASNA WingsRPG™ Reference Manual

Wings Record Format

Wings Record Format (.wrf)

A .wrf file contains information about each record format in an Wings (aspx) display file. This critical information allows the Wings runtime to perform Record Level checks to guarantee that the RPG program's display file records match the format of the aspx records. These files can be identified by their .aspx.wrf extension. These records are automatically generated and updated when the DDS file is imported AND when the Display File is exported back to the IBM i library. The format is shown below.

<WingsRecordFormat LvlChk="*YES" CcsId="37">
  <!--This portion is generated by Wings, do NOT change it-->
  <Layout Version="1.0" Sha1="pwafwChTQejcOTYyzl+KpHxLRU0=">
    <LastWrite T="634352898063549873" />
         <Format FormatName="SALESREC" FormatLevel="180258555D136">

Notice the LvlChk attribute which allows the programmer to indicate whether they want record level checks (*Yes) or not (*No). See the topic The Runtime Cycle, LevelCheck and LwtChk for more information.

During ASNA Wings Runtime

Inside the WingsRecordFormat lies the layout of the file records. This section should not be changed by hand, otherwise if the Wings runtime detects that the record information has been compromised it will issue an error during record level checks. The record level checks happen when the file is Opened and go as follows:

  1. The contents of the Layout section are hashed and the value is compared against the Sha1 attribute. If the values differ then the Layout section has been modified and is not to be trusted, so level checks cannot proceed and an error is issued.
  2. Since the date of the aspx is different than the LastWrite tag,
  3. If the Sha1 values match, then the LastWrite tag contains the date when the aspx file was last written to disk at the time the Wrf was created. If this date and the current 'last written date' on the aspx file match, then proceed to step 4.
  4. This means the aspx file has been edited since the Wrf was created. If the website is running a release version with a web.config that states DEBUG=FALSE, then level checks cannot proceed and an error is issued. If the site is running in debug mode then a new layout is computed for the current contents of the aspx and if it is NOT equivalent to the Layout section of the Wrf, then an error is issued. Otherwise, the LastWrite tag is updated and the process continues to the next step.
  5. The FormatLevel attribute of each record is checked against the format levels of the Display File used when the program was compiled. These format levels must match for the Open process to succeed.
  6. As processing continues, the CCsId property value in this record is used to translate record names.

See Also: The Runtime Lifecycle, LevelCheck and LWTCheck