Using a simple Client Access data transfer you can select which lines from a RPG source send to a *.txt file in order to document it.
In this case I have chosen comment and begsr/endsr lines.
I find this very helpful and easy. In order to work properly you have to replace the following fields by their values
------------
HOSTAME
LIBRARY
FILE
MEMBER
------------
[DataTransferFromAS400]
Version=1.0
[HostInfo]
HostName=HOSTNAME
HostFile=LIBRARY/FILE(MEMBER)
[ClientInfo]
OutputDevice=2
PCFileType=1
PCFile=D:My DocumentsMy Received Filessource.txt
CrtOpt=1
SaveFDF=1
FDFFile=D:My DocumentsMy Received Filessource.FDF ConvType=0
FileOps=7
ASCIITruncation=1
[SQL]
Select=substr(srcdta, 7, 70)
Where=substr(srcdta, 7, 1) = '*' or substr(srcdta, 28, 5) in ('BEGSR',
'ENDSR')
OrderBy=
GroupBy=
Having=
JoinBy=
SQLSelect=
EnableGroup=0
MissingFields=0
[Options]
IgnoreDecErr=1
TimeSep=[:]
TimeFmt=HMS
DateSep=[/]
DateFmt=MDY
DecimalSep=.
SortSeq=0
SortTable=
Lang=0
LangID=
[HTML]
AutoSize=0
OverWrite=1
Charset=windows-1252
ConvInd=0
Title=
IncDateTime=0
DateTimeLoc=0
TabAlign=0
TabRows=2
TabCols=2
TabBW=1
TabCS=1
TabCP=1
TabWidth=100
TabWidthP=0
TabMap=1
CapAlign=0
CapStyle=1
CapSize=6
CapIncNum=0
Caption=
RowAlignHdrV=0
RowAlignHdrH=0
RowAlignGenV=0
RowAlignGenH=0
RowSytleHdr=1
RowStyleGen=1
CellAlignT=0
CellAlignN=0
CellWrap=1
CellSize=6
UseTemplate=0
Template=
TemplateTag=
[Properties]
Check4Untrans=0
Convert65535=0
UseAlias=1
Notify=1
SQLStmt=0
AutoRun=0
AutoClose=0
Note: This is a simple file transfer, there are three tricks you should be aware of:
a) It reads a member from a source pf.
b) It uses the file transfer's facility to select certain records using a SQL select statement.
c) If you'd like to document not all the comments but just some of them you could create your own criteria and only select those that match it
(i.e.: only those lines with '*.' will be documented, so the only thing that you need to do is to change the SQL where clause).
Please see this example of the documentation as it, and the file transfer itself.
==================================
MORE INFORMATION ON THIS TOPIC
==================================
The Best Web Links: tips, tutorials and more.
Ask your programming questions--or help out your peers by answering them--in our live discussion forums.
Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.