Sometimes it is necessary to obtain a 'trace' for a DataGate/400 run when trying to diagnose
a problem. These are the steps needed to obtain such a trace. A debuggable
version of DataGate/400 is shipped with DataGate/400 an resides on the CD.
- Download and Unzip the DataGate/400 Debug Program. Within this zip
file is an AS/400 SAVF:
ftp://ftp.asna.com/datagate/dg8debug.zip
- Sign onto the AS/400 using an account with *SECOFR authority;
- On the AS/400, create a library (temporary) called ASNADLVR: (NOTE: QTEMP must not be used).
CRTLIB ASNADLVR
- Add this library to the library list:
ADDLIBLE ASNADLVR
- Create a Save file.
CRTSAVF FILE(ASNADLVR/DG8SF)
- Start FTP using the following FTP command
FTP as400tcpipaddress
NOTE: Where as400tcpipaddress is either a TCP/IP address such as 198.176.129.35, or a machine name that is registered either in a DNS or a HOSTS file.
When prompted for a user name and password, enter the appropriate information that will give you privileges to upload data to the AS/400.
- Upload the Save file containing the Debug programs to the
400 from the CD using the following put commands
a) binary
b) put dg8debug ASNADLVR/DG8SF
NOTE: Where dg8debug is the file you downloaded and extracted from ASNA
FTP site.
c) quit
- End the DataGate service by entering the ENDDG8SVR command. Verify
that there are no active connections to DataGate.
- Rename the object DataGate, type *PGM in the DataGate installation
library.
NOTE: The default DataGate installation library is called DG8_40. RNMOBJ
OBJ(xxx/DataGate) OBJTYPE(*PGM) NEWOBJ(DataGateBK)
- Restore the DataGate debug program using the Restore Object command:
RSTOBJ OBJ(DATAGATE) SAVLIB(ADBTASS) DEV(*SAVF) SAVF(ASNADLVR/DG8SF)
RSTLIB(XXX)
For DataGate/400 5.0, restore the DG8RISC SAVF within the DG8SF, then perform
the following command:
RSTOBJ OBJ(DATAGATE) SAVLIB(ADBTASS) DEV(*SAVF) SAVF(ASNADLVR/DG8RISC)
RSTLIB(XXX)
NOTE: XXX denotes the DataGate installation library
- Create a data area called DGTRACE with the following
command in the DataGate Installation Library.
CRTDTAARA DTAARA(XXX/DGTRACE) TYPE(*char) LEN(1) VALUE('3')
NOTE: when XXX denotes the
DataGate installation library
- The amount of tracing output can be varied with
the value in the DGTRACE data area as follows:
- Start the DataGate service (STRDG8SVR) and run the application that makes a connection to the AS/400 using
DataGate/400.
A source-physical file named DGTRACE
will appear in the installation library if it doesn't already exist. Members
will be added to the DGTRACE file whose names correspond to the job numbers for the trace-enabled
DataGate jobs. Member names will have a prefix of "DG" followed by the
job number for the DataGate job. (e.g., DG58435)
- Get the trace:
Using ADBFM's CopyData, you can copy the file and along with the
corresponding trace member to your local ADB database. The file can then be
archived and attached to an email and sent to ASNA. You can also save the
physical file on the AS/400 into a Save File and FTP the Save File to your
pc. The Save File can then be attached to an email and sent to ASNA.
Notes for using tracing while replicating a bug:
- Tracing does NOT duplicate the information available in the job log. System errors and
such will not occur in the trace log. It may be necessary to obtain a job log output
in addition to a trace log in many, if not most cases.
- The end user would need "object create" authority (or
equivalent) over the installation library as each new connection will
cause a new member to be created in DGTRACE.
- Run-time output can be controlled. The amount of tracing output can be varied with
the value in the DGTRACE data area as follows:
- Terminate Tracing. In order to terminate tracing, you will
need to stop the Datagate Service by issuing the ENDDG8SVR command. Verify that
all connections have ended and restore the original Datagate program.
DLTPGM PGM(xxx/Datagate) - Delete Datagate trace program
RNMOBJ OBJ(xxx/DatagateBK) OBJTYPE(*PGM) NEWOBJ(Datagate)
- Restore original Datagate program.
- Start the Datagate Service:
DG8_40/STRDG8SVR
ASNA KB Articles:
Keywords: debug, Jobs, log, trace