rtf tips and tricks trnsport users group presentation october 15, 2004
TRANSCRIPT
![Page 1: RTF Tips and Tricks Trnsport Users Group Presentation October 15, 2004](https://reader035.vdocument.in/reader035/viewer/2022072006/56649cfe5503460f949cf3f8/html5/thumbnails/1.jpg)
RTF Tips and TricksRTF Tips and Tricks
Trns•port Users GroupPresentation
October 15, 2004
![Page 2: RTF Tips and Tricks Trnsport Users Group Presentation October 15, 2004](https://reader035.vdocument.in/reader035/viewer/2022072006/56649cfe5503460f949cf3f8/html5/thumbnails/2.jpg)
Why We’re HereWhy We’re Here
• C/S Release 5 added a lot to RTF
• RTF was added to SiteManager fairly recently
• Many people haven’t worked with it, or aren’t aware of all its capabilities
• This is not an RTF class
![Page 3: RTF Tips and Tricks Trnsport Users Group Presentation October 15, 2004](https://reader035.vdocument.in/reader035/viewer/2022072006/56649cfe5503460f949cf3f8/html5/thumbnails/3.jpg)
Zen and the Art of RTFZen and the Art of RTF
• Read the manual, significant updates in December 04 release
• Study existing templates– Adapt, instead of re-invent, if possible
• Develop reports incrementally– Logic before formatting– Outline– Work from the outside in– Develop as plain text report first
![Page 4: RTF Tips and Tricks Trnsport Users Group Presentation October 15, 2004](https://reader035.vdocument.in/reader035/viewer/2022072006/56649cfe5503460f949cf3f8/html5/thumbnails/4.jpg)
Save Someone’s SanitySave Someone’s Sanity(possibly even your own)(possibly even your own)
• Develop with sharing in mind– e.g., multiple-project proposals/contracts
• Comment, comment, comment– Then comment some more– RTFLOG.TXT is your friend
• Indent code blocks• Comment ENDIFs, ENDREPEATs, etc.
![Page 5: RTF Tips and Tricks Trnsport Users Group Presentation October 15, 2004](https://reader035.vdocument.in/reader035/viewer/2022072006/56649cfe5503460f949cf3f8/html5/thumbnails/5.jpg)
Enhance Your PerformanceEnhance Your Performance
• SELECT * usually isn’t the best query– Do you really need all the columns?
• Avoid WHERE_OR_AFTER– Retrieves ALL rows matching the
condition
• Keep database keys in mind• Keep unnecessary statements out of
loops
![Page 6: RTF Tips and Tricks Trnsport Users Group Presentation October 15, 2004](https://reader035.vdocument.in/reader035/viewer/2022072006/56649cfe5503460f949cf3f8/html5/thumbnails/6.jpg)
Good Stuff™Good Stuff™
• NUM_ROWS special variable– Gives the number of rows that the latest GET or
REPEAT command found
• FOUND special variable– Returns true if the latest GET or REPEAT
command found a record that matches the condition in the command
• “&!” can be used as a pointer of sorts (code_ex.) (output_ex.)
![Page 7: RTF Tips and Tricks Trnsport Users Group Presentation October 15, 2004](https://reader035.vdocument.in/reader035/viewer/2022072006/56649cfe5503460f949cf3f8/html5/thumbnails/7.jpg)
More Good StuffMore Good Stuff
• Exporting data using RTF– CSV, COLUMNAR built in– Can also export any text-based format, e.g., XML, HTML
• Running external programs and DLL functions within an RTF template (code_ex.)(rawout_ex.)(finout_ex.)
![Page 8: RTF Tips and Tricks Trnsport Users Group Presentation October 15, 2004](https://reader035.vdocument.in/reader035/viewer/2022072006/56649cfe5503460f949cf3f8/html5/thumbnails/8.jpg)
Exporting DataExporting Data
• From CAS ArchiveContracts.rtf:
%LET table_name = "CONTMOD"%REPEAT OVER CONTMOD WHERE CONTID IS
SUBSET.CONTID%EXPORT CSV table_name, SUBSET.CONTID,, CONTMOD.CMODTYPE,,...
![Page 9: RTF Tips and Tricks Trnsport Users Group Presentation October 15, 2004](https://reader035.vdocument.in/reader035/viewer/2022072006/56649cfe5503460f949cf3f8/html5/thumbnails/9.jpg)
Calling an External Program – Calling an External Program – Example 1Example 1
• From SiteManager SMVend2ebs.rtf:
%load SystemCall...%let OutputFile = t_cd_tbl_dtl.cd_desc...%call plug in SystemCall( "if exist " ||
OutputFile || " del " || OutputFile )...
![Page 10: RTF Tips and Tricks Trnsport Users Group Presentation October 15, 2004](https://reader035.vdocument.in/reader035/viewer/2022072006/56649cfe5503460f949cf3f8/html5/thumbnails/10.jpg)
Calling an External Program – Calling an External Program – Example 2Example 2
• From CAS casecnt.rtf:
%load SystemCall...%call plug in SystemCall( "del " ||
CFBEXPTDIR || "\d" || subset.cnfacs || ".dat" )
...
![Page 11: RTF Tips and Tricks Trnsport Users Group Presentation October 15, 2004](https://reader035.vdocument.in/reader035/viewer/2022072006/56649cfe5503460f949cf3f8/html5/thumbnails/11.jpg)
What on Earth is CFBEXPTDIR?What on Earth is CFBEXPTDIR?
• Environment variable– Defined in ITIDPSSV.CFG– Other job-specific variables are defined in
the job parameter file
• Other examples: OutFiles, SysFiles– For a list, look at a JOBPARM.TXT file– JOBEXEC.TXT also handy
![Page 13: RTF Tips and Tricks Trnsport Users Group Presentation October 15, 2004](https://reader035.vdocument.in/reader035/viewer/2022072006/56649cfe5503460f949cf3f8/html5/thumbnails/13.jpg)
Questions??Questions??