Updating the column heading of a Physical File

180 pts.
Tags:
AS/400
Physical File
RPGLE
Is it possible to update the column heading's of PF in an RPGLE program ?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Yes
You would need to run the ‘LABEL ON’ SQL Statement.
Here is a sample of code that changed the column heading for field JOBID from ‘Job ID’ to ‘NEW COLUMN HEADING’
File is CD053DB In library Charlieb

LABEL ON COLUMN CHARLIEB/CD053DB (JOBID IS ‘NEW COLUMN HEADING’)

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    To try CharlieBrowne's suggestion, copy QIWS/QCUSTCDT into 'mylib'. Run SELECT * FROM mylib/QCUSTCDT in one workstation session. Then call this program in a second session:
         H dftactgrp( *NO )
         H    actgrp( *CALLER )
    
          /free
           exec sql LABEL ON COLUMN mylib/QCUSTCDT (CUSNUM IS
                    'Cust                Number')                           ;
           exec sql COMMIT                                                  ;
    
            *inLR = *on ;
            return ;
          /end-free
    If you haven't returned from the SELECT in the first session, you'll need to get back to the SQL command line because the program will need to establish an *EXCL lock on the mylib/QCUSTCDT object before it can make the change. (This is a change to the object, not to the data.) As soon as STRSQL ends the query, the program should finish. You can then run the SELECT again to see that the column heading has changed. Tom
    125,585 pointsBadges:
    report
  • WoodEngineer
    In the prior millennium there was a utility published in one of the AS/400 journals that does exactly what you want. We are now on V5R4 and it still works just fine. This is the command.
                        Change field TEXT and COLHDG (CHGFFDTXT)         
                                                                         
     Type choices, press Enter.                                          
                                                                         
     File . . . . . . . . . . . . . .                 Name, *NONE        
       Library  . . . . . . . . . . .     *LIBL       Name, *LIBL        
     Field Name . . . . . . . . . . .                                    
     Text Description . . . . . . . .   *SAME                            
     Column Heading Line 1  . . . . .   *SAME                            
     Column Heading Line 2  . . . . .                                    
     Column Heading Line 3  . . . . .                                    
      
    The command processing program in a CL, which calls an RPG. Too much code to list here. <<Does anyone know a way to post source code as individual text file on this site? >> If you want to post your e-mail address I'll try to send you the source.
    6,875 pointsBadges:
    report
  • TomLiotta
    To post large amounts of code you might use a site such as PasteBin. That's been around for quite a while and seems reliable. Try uploading a couple items to learn how it works. Be aware of potential copyright/attribution issues when posting published code. Tom
    125,585 pointsBadges:
    report
  • WoodEngineer
    Tom . . . thanks for the tip about pastebin.com. I created an ITKE sub-site for posting code by IT Knowledge Exchange members. The source for the three objects (Cmd, CL, RPG) is available at
    6,875 pointsBadges:
    report
  • WoodEngineer
    Oops. The link did not make it. Try http://itke.pastebin.com/Z4Q6Fke5
    6,875 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following