Change DDS COLHDG Values

General
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Most of us have files on our systems with fields that have Column Headings (COLHDG) and field Text (TEXT) that are poorly worded. We tend to leave them that way because we don't want to take the time to perform all of the steps required to create a new file. Hopefully, we remember to make the change the next time we modify the file.

Using the SQL "LABEL ON" statement, you can quickly and easily change the column headings or text without recompiling the file. You can, of course use SQL/400 to execute the statement, but you can also use Query Management/400. This means you can do this on any AS/400.

Before you run the LABEL ON statement, make sure you don't have any programs which depend on the values in the column headings or text. Changes to the values for these attributes are reflected in all files which share the record format. Typically, logical files share the record format with the physical file but they do not have to.

You must run the LABEL ON statement twice if you wish to change both column heading and text for a field.

To change a field's column headings, use a statement similar to the first one in 7. The character string for the column heading consists of three 20- byte segments (column heading 1 begins at byte 1, column heading 2 begins at byte 21 and column heading 3 begins at byte 41). The string can be no longer than 60 bytes. You can specify one, two, or three segments. You can even remove all column heading text by specifying a null string (''). In that case, programs such as QUERY/400 return the field name as the column heading.

To change a field's column headings, use a statement similar to the first one in Figure 7. The character string for the column heading consists of three 20- byte segments (column heading 1 begins at byte 1, column heading 2 begins at byte 21 and column heading 3 begins at byte 41). The string can be no longer than 60 bytes. You can specify one, two, or three segments. You can even remove all column heading text by specifying a null string (''). In that case, programs such as QUERY/400 return the field name as the column heading.

To change a field's text, use a statement similar to the second one in 7. The string in quotes can be no longer than 50 bytes.

To change a field's text, use a statement similar to the second one in Figure 7. The string in quotes can be no longer than 50 bytes.

You need to keep in mind that this method can cause your files to become unsynchronized with their corresponding DDS source. Whenever you use the LABEL ON statement to modify the column heading or text fields of a file, you should also change a file's DDS source member.


Change DDS COLHDG Values

Figure 7 Changing Column Headings and Text with SQL

 To change a field's column heading: LABEL ON ARLIB/CUSTOMER (CUACT IS 'Column Heading 1 Column Heading 2 Column Heading 3') To change a field's text: LABEL ON ARLIB/CUSTOMER (CUACT TEXT IS 'Field-Text') 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: