TechTalk: Files Used by Queries

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

When you change the definition of a file on the AS/400, you'll often have to recompile all objects that access that file. For example, if you add a century flag to a date field of a certain file, you need to change the DDS for the file and recompile it. Now all objects accessing that file will need to be recompiled if you re-create the file with LVLCHK(*YES), which is the default setting.

You can determine what programs to recompile by running the Display Program References (DSPPGMREF) command to an outfile, this prints the list of programs that you have to recompile. The problem comes with Query/400 programs that may use the changed file, since the DSPPGMREF command does not cross-reference Query programs. If a Query uses the changed file for input or output, the Query will abend the next time a program tries to run it, displaying the message, "Level for file does not match query."

To solve this problem, always code the file name into the Run Query (RUNQRY) command that runs your Query programs, so that the value of the QRYFILE parameter matches the name of the file that you defined in the Query. For example, instead of the line:

 RUNQRY QRY(TRY) ...code the following: RUNQRY QRY(TRY) + QRYFILE((SRS/SRSD110A)) + OUTTYPE(*OUTFILE) + OUTFILE(TEMP/WORKING) 

Sure, you have to type more into the CL program, but now you can use the Scan All Source (SCNALLSRC) command, which is part of QUSRTOOL, to search for the file name and obtain a complete picture instead of a partial one.

Editor's Note: You can also use the Find String with PDM (FNDSTRPDM) command instead of SCNALLSRC.

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: