Home > AS/400 Tips > iSeries programmer tips > Using SDA to create printer files
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES PROGRAMMER TIPS

Using SDA to create printer files


John Kohan
08.09.2000
Rating: -3.72- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Did you know you could use Screen Design Aid (SDA) to create printer files? All of us use SDA everyday to create screens, but the only tools we have for printer files are SEU, RLU and Code Designer. I have seen people code extraordinary printer files in SEU, but the mass of RPG programmers just do not do enough printer files to hone our skills to that level.

When creating a printer file, begin just like you would a typical screen. Select the screen size (80 or 132 column) and begin to layout the report in SDA. I prefer to design my printer files from the top down. First I create the HEADER then DETAIL, TOTALS if I need them, and finally the FOOTER. After you create each record, make sure you sort the source code by pressing F4 followed by F6. This will ensure that your source code is easy to read and maintain.

After you complete your design in SDA and sort the source code, exit without creating the screen. Next, edit the source code using SEU. Once opened, press F13 and change the type from DSPF to PRTF. Return to the source and delete the DSPSIZ statement. Next, remove any keyboard shifts of "Y". Now go down to the DETAIL, TOTALS and FOOTER and remove the line numbers, then place a "SPACEB(1)" at each record level. The last thing you do is change the display attributes from DSPF type to PRTF types. Press F14 (Find and Replace) and enter DSPATR(HI) on line one and HIGHLIGHT on line two. Press enter, then press F17 repeatedly until all instances have changed. Now do the same thing for DSPATR(UL) to UNDERLINE. Exit your source and compile.

You will find that after just two or three times, this will become very natural. Also look at the way you can create your column headings as one field and get an underline from column 1 to column 132. I can create a typical printer file in under 10 minutes and never have to go back to move fields around to line them up with one another.

About the author:Kohan is a senior programmer analyst for a software development company. He has worked with the AS/400 since 1990 and has learned how to use the platform to solve business problems. He is also an adjunct instructor, teaching AS/400 classes at his local state college.

Clarification

After this tip was sent out to readers, the author realized he forgot to include two steps:

There are two things you need to do to create a display file width of 132. First do what you did to client access, which is change the session default to 132. The other thing is, once you are in SDA at the "Work With Display Records" is to press F14 for file keywords. Put a "Y" in front of "Display Sizes" and press enter. Put a 1 on the "27 X 132" line and remove the "1" from the 24 X 80 line. Now just press enter until you return to the "Work With Display Records" and proceed as indicated in the tip.

--------------------------------------------------------------------
READER FEEDBACK
--------------------------------------------------------------------

Robert Horbach said:
This is extremely cumbersome and leaves much to be desired, particulary if trying to design reports beyond 132 columns. I would suggest making an investment in a software package called Report Design Aid ('RDA'), which looks like SDA and makes designing reports as easy as SDA.


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
iSeries programmer tips
Enhancing RPG with external SQL stored procedures
Tracking data changes on IBM i with triggers
Introduction to SQLRPGLE on IBM i: Making a report
Implementing a browser interface in COBOL: Displaying database fields
Taking advantage of CL advancements, starting with V5R3
TAATOOL: Useful tools for programmers on IBM i
Implementing a browser interface in COBOL: Creating your graphic Web page
Implementing a browser interface in COBOL: Getting started
Making the most of RPG data handling on IBM i
Groovy programming on IBM i

Printing on iSeries
Printing from the iSeries
How to print RPG output using iSeries Access
Acknowledging control characters in a print file on IBM i without writing a program
Direct default print job to tray 2 from IBM i
Set up a HP Deskjet 6988 with a built-in internal NIC as a stand-alone printer
Solve printing problems when using Personal Communications 5.7
Determine printing options available for preprinted medical forms
Messages and spool hanging up SAVLIB jobs when OUTPUT(*PRINT) is specified
Using AFPRSC to print .jpg or .pdf files from the IFS on AS/400
Print overlays from the AS/400 using the IBM AFP printer driver
Printing on iSeries Research

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Advanced Function Printing  (Search400.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts