Você está na página 1de 6

iSeries EXTRA: Using Conditional Compiler Directives | IBM i | IBM Sy...

1 of 6

http://www.ibmsystemsmag.com/ibmi/november01/enewsletterexclusive/...

Administrator
Backup and Recovery
DB2
High Availability
LPAR
Networks
Performance
Security
Systems Management
Tivoli
Trends
AIX
Linux
Open Source
What's New
Tips & Techniques
Application Development
Systems Management
Miscellaneous
Case Studies
Automotive
Healthcare
Manufacturing
Miscellaneous
Non-profit
Retail
Storage
Disk
Servers
Software
Tape
Product News
Buyer's Guide

Developer
General
Java
Modernization
RPG
WebSphere
Trends
IBM Announcements
Linux
Open Source
SOA
What's New

9/27/2010 9:01 AM

iSeries EXTRA: Using Conditional Compiler Directives | IBM i | IBM Sy...

2 of 6

http://www.ibmsystemsmag.com/ibmi/november01/enewsletterexclusive/...

Case Studies
Automotive
Banking/Finance
Healthcare
Insurance
Manufacturing
Miscellaneous
Non-profit
Retail
Storage
Disk
Optical
Servers
Tape
Product News
Product Reviews
ENDPGM Main Page
Administrator
Backup and Recovery
CICS
DB2
High Availability
IMS
LPAR
Migration
Networks
Performance
Security
Systems Management
Tivoli
Trends
Linux
Open Source
Security
SOA
What's New
z/OS
z/VM
Tips & Techniques
Application Development
Systems Management
Case Studies
Automotive
Banking/Finance
Healthcare
Insurance
Manufacturing
Miscellaneous
Retail
Storage
Disk
Servers
Software
Tape
Product News
Stop Run
Buyer's Guide Main Page

9/27/2010 9:01 AM

iSeries EXTRA: Using Conditional Compiler Directives | IBM i | IBM Sy...

3 of 6

http://www.ibmsystemsmag.com/ibmi/november01/enewsletterexclusive/...

Business Strategy
Competitive Advantage
Consolidation
Executive Perspective
Green IT
Migration
Open Source
ROI
Infrastructure
Blades
Storage
Systems Management
Case Studies
Distribution
Healthcare
Manufacturing
Services
Web 2.0
Cloud
Social Media
Trends
Collaboration
IBM Announcements
IBM Research
Open Source
Social Media
What's New
Product News

AIX
MAINFRAME
POWER
Newsletters
About Us

Subscribe
Current Issue
Archive

IBM i
ALL EDITIONS
ADMINISTRATOR
DEVELOPER
TRENDS
TIPS & TECHNIQUES
CASE STUDIES

9/27/2010 9:01 AM

iSeries EXTRA: Using Conditional Compiler Directives | IBM i | IBM Sy...

4 of 6

http://www.ibmsystemsmag.com/ibmi/november01/enewsletterexclusive/...

STORAGE
PRODUCT NEWS
ENDPGM
BUYER'S GUIDE

Developer > RPG

iSeries EXTRA: Using Conditional Compiler Directives


November 2001 | by Susan Gantner and Jon Paris

Print

Email

The capabilities offered by these compiler directives can be useful when dealing with prototypes for subprocedures. The RPG IV compiler insists that the prototypes
be present in the source that defines the subprocedures. The normal method of handling this is to have the prototypes in a separate source member and /COPY
them into both the source that defines the subprocedures and any other sources that use them. Conditional Compilation Directives can be used to avoid the
requirement for this extra source member. While we don't have room here to show you all the details, Sample 1 is a fully worked example.
What else can these directives be used for? A couple of suggestions follow:
You can maintain a single source for two or more "almost" identical programs. This is much better than cloning the source, since any maintenance changes
need only be made in a single place. For details, see Sample 2.
You can ensure that a /COPY member which is included by multiple other /COPY members is only incorporated into the compile once. For details, see
Sample 3.
You can no doubt think of many other uses for these conditional directives; in fact, we'd love to hear about them. E-mail us with your personal favorites.

Page 1 2
Susan Gantner is a technical editor with IBM Systems Magazine and co-owner of Partner400.
More Articles From Susan Gantner
Jon Paris is a technical editor with IBM Systems Magazine and co-owner of Partner400.
More Articles From Jon Paris

Advertisement

9/27/2010 9:01 AM

iSeries EXTRA: Using Conditional Compiler Directives | IBM i | IBM Sy...

5 of 6

http://www.ibmsystemsmag.com/ibmi/november01/enewsletterexclusive/...

WEBINAR -- RPG OA and Beyond from looksoftware Tuesday, September 28, 2010, 10 am BST (Europe)
Wednesday, September 29, 2010, 2 pm EST (USA)

Browse products and services for Developer.

Advertisement

Maximize your IT investment with monthly information from THE source...IBM Systems Magazine EXTRA & Marketplace eNewsletters.
SUBSCRIBE NOW.

9/27/2010 9:01 AM

iSeries EXTRA: Using Conditional Compiler Directives | IBM i | IBM Sy...

6 of 6

http://www.ibmsystemsmag.com/ibmi/november01/enewsletterexclusive/...

View past IBM i EXTRAs here

Related Articles
RPG for the Web
Paging RPG IV
iSeries EXTRA: Service Programs and Signatures
E-Newsletter Exclusive
Get More from RPG
E-Newsletter Exclusive | SPECIAL files process IFS directories and more
Three Good Reasons to Stop Writing Subroutines
E-Newsletter Exclusive | Save time and reduce errors with subprocedures
IBM i
AIX
MAINFRAME
POWER
Homepage
About Us
Contact Us
Subscriptions
Editorial Calendar
Advertise With Us
Reprints
Privacy Policy
Terms of Service
Sitemap
IBM Systems Magazine is a trademark of International Business Machines Corporation. The editorial content of IBM Systems Magazine is placed on
this website by MSP TechMedia under license from International Business Machines Corporation.
2010 MSP Communications, Inc. All rights reserved

9/27/2010 9:01 AM

Você também pode gostar