Please enable JavaScript to view this site.

Manual InterForm400 English 2023

Navigation: Journaling

Roll back changes in journal

Scroll Prev Top Next More

It is possible in InterForm400 to roll back changes, that you have done in either the graphical designer or during imports via the journal menu, but the journal of InterForm400 actually contains entries of as good as any change in InterForm400, so it is possible to roll back other changes in InterForm400 via the journal.

 

A prerequisite is, that the journaling was active, when the changes where done.

 

Important disclaimer

Doing changes to the InterForm400 databases is dangerous and can cause major problems in InterForm400, which can prevent InterForm400 from working correctly.

You should only proceed, if you have a backup of the APF3812 library, and you should even consider a restore of the library (or individual files) instead of rolling back via the journal.

 

If you corrupt the InterForm400 databases, and then require help from InterForm400, then the help is NOT included in your normal maintenance contract (if you have one), and you will be charged for the time used.

 

The suggestions below are delivered as is and may not work in newer versions of InterForm400 as additional files might have been introduced without this section has been updated.

 

InterForm A/S cannot be held responsible for any damages or loses caused directly or indirectly by the suggestions below. Use the suggestions below at your own risk.

 

Only proceed with caution, and verify each step carefully before executing the RMVJRNCHG command.

 

In the sections below there are examples for:

1.Roll back changes for a deleted output queue in Auto Forms Control

2.Roll back changes for a deleted overlay.

 

 

 

Roll back a delete of an output queue in Auto Forms Control

One example where a roll back can be useful is, if an AFC definition is deleted (or changed) by mistake. The related database files are: APF3812/AFCDEFP (which contains the detail lines) and APF3812/AFCMSTP (which contains the header data of the AFC definitions).

 

If you are in this situation, then you first need to find out exactly which journal entries, that you want to roll back. To do that you need to look into the entries of the journal. Below I assume, that you are using the standard journal: APF3812/APFJRN, but the name and library of the journal is configurable.

 

To find the journal entries, that you want to roll back, you need to use the command, DSPJRN. Some of the parameters can be used for setting a start and end date and time like below:

 

DSPJRN JRN(APF3812/APFJRN) FROMTIME('17/09/20' 100000) TOTIME('17/09/20' 110000)

(The date format might be different on your machine, you can verify that with e.g. DSPSYSVAL QDATE)

 

In the example above I suspect, that the relevant change was done between 10:00 and 11:00 on 17th of September 2020.

 

When the command is run you will see this:

 

 

                            Display Journal Entries                        

                                                                          

 Journal  . . . . . . :   APFJRN          Library  . . . . . . :   APF3812 

 Largest sequence number on this screen  . . . . . . : 00000000000000000071

 Type options, press Enter.                                                

   5=Display entire entry                                                  

                                                                          

                                                                          

 Opt    Sequence  Code  Type  Object      Library     Job         Time     

              58   R     UB   APFFMTP     APF3812     QPADEV0004  10:34:32 

              59   R     UP   APFFMTP     APF3812     QPADEV0004  10:34:32 

              60   R     UB   APFFMTP     APF3812     QPADEV0004  10:36:00 

              61   R     UP   APFFMTP     APF3812     QPADEV0004  10:36:00 

              62   R     UB   APFFMTP     APF3812     QPADEV0004  10:36:29 

              63   R     UP   APFFMTP     APF3812     QPADEV0004  10:36:29 

              64   R     UB   APFFMTP     APF3812     QPADEV0004  10:36:45 

              65   R     UP   APFFMTP     APF3812     QPADEV0004  10:36:45 

              67   R     DL   AFCDEFP     APF3812     QPADEV0004  10:43:28 

              68   R     DL   AFCDEFP     APF3812     QPADEV0004  10:43:28 

              70   R     DL   AFCMSTP     APF3812     QPADEV0004  10:43:28 

                                                                       More... 

 F3=Exit   F12=Cancel                    

                                       

 

For the changes in Auto Forms Control you need to search for entries, that refer to the files: APF3812/AFCDEFP and APF3812/AFCMSTP (and perhaps other files in future versions of InterForm400). From the view above it seems, that we want to roll back the sequences 70 to 67, as they refer to the relevant files.

 

The type column is DL, which indicates delete of records.

 

With option 5=Display entire entry you can see the data, that has been deleted:

 

                            Display Journal Entry                            

                                                                             

Object . . . . . . . :   AFCDEFP         Library  . . . . . . :   APF3812    

Member . . . . . . . :   AFCDEFP                                              

Incomplete data  . . :   No              Minimized entry data :   *NONE      

Sequence . . . . . . :   67                                                  

Code . . . . . . . . :   R  - Operation on specific record                    

Type . . . . . . . . :   DL - Record deleted                                  

                                                                             

            Entry specific data                                              

Column      *...+....1....+....2....+....3....+....4....+....5                

00001      'KSE       QUSRSYS      N  *STD                    '              

00051      '                                                  '              

00101      '                                     *INPUT       '              

00151      '             *NO              *COL *NO  IF400DEMO '              

00201      'SAMPLE            1          *NO             *SPLF'              

00251      'OWNER       DEMOPDF                               '              

00301      '                                                  '              

                                                                       More...

Press Enter to continue.                                                      

                                                                             

F3=Exit   F6=Display only entry specific data                                

F10=Display only entry details   F12=Cancel   F24=More keys                

 

In this way you can also verify, if you have found the right entries in the journal.

 

There are other ways to subset the lines of the DSPJRN: You can e.g. restrict the list to only include changes of specific files.

 

In the case above we are now completely sure, that we want to roll back the delete of the records mentioned in sequence 70 to 67. Please notice, that we need to roll back backwards from the latest number to the first number.

 

Before we can roll back, we need to be sure, that no jobs are using the related files i.e. in order to roll back changes to Auto Forms Control files you need to stop the Auto_Form subsystem and ensure, that no one is editing definitions in Auto Forms Control.

 

Now we can finally execute the roll back with this command:

QSYS/RMVJRNCHG JRN(APF3812/APFJRN) FILE((APF3812/AFCDEFP) (APF3812/AFCMSTP)) FROMENTLRG(70) TOENTLRG(67)

 

In older OS400 versions you might need to run this command instead:                                                                            

QSYS/RMVJRNCHG JRN(APF3812/APFJRN) FILE((APF3812/AFCDEFP) (APF3812/AFCMSTP)) FROMENT(70) TOENT(67)                            

 

Please notice, that I have specifically listed the files, that I want to update. This is to be double sure, that I am not rolling back changes for any other files no matter what happens.

 

After the roll back we can verify, that the roll back was successful and then we can start the Auto_Form subsystem again.

 

If the roll back was not successful, then you should consider a restore of either the involved files or the complete APF3812 library.

 

 

 

Roll back changes for a deleted overlay

The procedure to roll back a deleted or changed overlays or restore the old definitions from a back up is very similar to the description above for the AFC definitions.

 

For the overlay (excluding the file set in which the overlay is placed) the data of the overlay is stored in a member with the same name as the file set.

 

The related files for an overlay are:

 

1) The file: APF3812/APFMSTP. This file contains the header of the overlays. There is only one record per overlay.

2) The file: APF3812/APFFMTP. This file contains the detail lines of the overlays.

3) The file: APF3812/APFPAGP. This file contains the data for the extended page definitions - if any has been defined for this overlay.

 

For a roll back via the journal you can use the description above for AFC definitions - except you need to exchange the files, APF3812/AFCDEFP and APF3812/AFCMSTP (which are for AFC definitions only) and instead refer to the files mentioned above.