Home > AS/400 Tips > iSeries programmer tips > Easy identification: Stamp objects with text
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES PROGRAMMER TIPS

Easy identification: Stamp objects with text


Tim Granatir, Search400.com expert
04.21.2003
Rating: -3.82- (out of 5)


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



Tim Granatir

Here's a simple program that uses an API to stamp objects with user-defined attribute text. You can change this user-defined attribute through the API, but you can't change it from IBM-supplied commands. Where the object text gets defined at the source level and carries through to the object level, this API works only on the object level.

I like the fact that you can stamp objects and use this as an additional way to group or identify things about your objects without losing your original object text. For instance, it can be an aid in identifying that your software is production-ready or it can be used to quickly determine what software enhancement/modification last touched this object.

One other thing you can do, although it isn't foolproof, is use this as a way to be reasonably sure that your production objects didn't get recompiled before moving them into production.

I prefer not to put a user interface on this process and instead build the work file through one or more DSPOBJD commands and then run this program when everything is ready.

An example set of commands would be the following:

DSPOBJD OBJ(SEARCH400/FNDMSG) OBJTYPE(*PGM) OUTPUT(*OUTFILE) OUTFILE(QTEMP/QADSPOBJ)
OVRDBF FILE(QADSPOBJ) TOFILE(QTEMP/QADSPOBJ)
CALL STAMPOBJ  

An example of a stamped object immediately follows the source listing.

FQADSPOBJIF  E                    DISK                     
I              'MY_VERSION'          C         VERSN       
I           SDS                                            
I                                        1  10 @PGM        
I                                      254 263 @USR        
C*                                                         
ISYSOBJ      DS                                            
I                                        1  10 ODOBNM      
I                                       11  20 ODLBNM      
IOUTREC      DS                                            
I                                    B   1   40NUMKEY      
I                                    B   5   80KEY#        
I                                    B   9  120KEYLEN      
I                                       13  22 DATA        
I                                        1  22 ALL         
C*                                                         
C                     EXSR INIT                            
C           1         SETLLQADSPOBJ                        
C*                                                         
C           *INLR     DOUEQ*ON                             
C                     READ QADSPOBJ                 LR     
C*  PROCESS RECORDS                                        
C           *INLR     IFEQ *OFF  
C*                                                                 
C                     MOVELODOBTP    OUTTYP 10 P                   
C                     CALL 'QLICOBJD'                              
C                     PARM           OUTLIB 10                     
C                     PARM           SYSOBJ                        
C                     PARM           OUTTYP 10                     
C                     PARM           ALL                           
C                     PARM           PERR   40                     
C                     END                                          
C                     END                                          
C*                                                                 
C***************************************************************** 
C*   INIT - INITIALIZATION SUBROUTINE                            * 
C***************************************************************** 
C*                                                                 
C           INIT      BEGSR                                        
C                     Z-ADD1         NUMKEY                        
C                     Z-ADD9         KEY#                          
C                     Z-ADD10        KEYLEN                        
C                     MOVELVERSN     DATA                          
C                     ENDSR                                        
C*     



Display Object Description - Full                        
                                                                 Library 1 of 1 
 Object . . . . . . . :   FNDMSG          Attribute  . . . . . :   CLP          
   Library  . . . . . :     SEARCH400     Owner  . . . . . . . :   QSECOFR     
 Library ASP device . :   *SYSBAS         Primary group  . . . :   *NONE        
 Type . . . . . . . . :   *PGM                                                  
                                                                                
 User-defined information:                                                      
   Attribute  . . . . . . . . . . . . :   MY_VERSION                            
   Text . . . . . . . . . . . . . . . :   FNDMSG command processing program
                                                                                
 Creation information:                                                          
   Creation date/time . . . . . . . . :   03/02/02  14:29:36                    
   Created by user  . . . . . . . . . :   QSECOFR                              
   System created on  . . . . . . . . :   S1036846                             
   Object domain  . . . . . . . . . . :   *USER                                 
                                                                                
                                                                                
                                                                                
                                                                        More... 
 Press Enter to continue.                                                       
                                                                                
 F3=Exit   F12=Cancel                                                           
 (C) COPYRIGHT IBM CORP. 1980, 2002.                                            

 

---------------------------
About the author: Tim is vice president of Technical Services at Interlink Technologies in Maumee, Ohio. He has worked in the banking, insurance, healthcare and distribution industries in various positions, including programmer/analyst, systems analyst and DP manager. Tim has worked on IBM midrange platforms since 1983.

==================================
MORE INFORMATION
==================================

  • Emphasizing source code
    Ever have some particular comment or section of code that you'd like to have stand out so that when the next person comes along he's sure to see it? Wouldn't it be nice to be able to highlight, reverse image, draw boxes, change the color of the source code, etc. for the source code you want to emphasize? Site expert Tim Granatir show you how.
  • Working with date and timestamp in DB2
    Is it possible for DB2/400 to automatically keep track of the timestamp when the record is inserted or updated? Yes, said DB2 UDB expert Kent Milligan, if you follow the correct steps.
  • Automatically create file names for daily reports
    If you have reports that run daily (or on any set schedule) you may want to be able to keep a history of past reports for some period of time. If your job overwrites the same file every day, you have to manually copy or rename it to keep it around for comparison. This bit of code will allow you to create a filename that ends with the date created (mm/dd) so that you can immediately know which day the report was run, as well as delete older reports in a timely manner.


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.




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



RELATED CONTENT
iSeries CL programming
Taking advantage of CL advancements, starting with V5R3
Checking in on your IBM i authorization lists
Running PHP open source applications: NOBODY needs authority
Simplify the process of converting a spool file from iSeries into an Excel spreadsheet
CL program for daily backups
An automated CL method of moving a query from AS/400 to Excel
Changing user password expiration
Eight steps for creating program documentation using AS/400 utilities
DAYSPAST CLLE program for AS/400: Compares object creation date with today's date
Advanced Job Scheduler help

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

Application Development
iSeries calling an .exe
Top 10 programmer tips
Formatted work job scheduler
Convert system date and time
Mixing free format code with embedded SQL
SQL update a field in one file from a field in another file
Webcasts for iSeries programmers
Programming advice from the pros
Easy code copying via the drag and drop method
Setting FTP time-outs

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