Show File Keys Utility

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

When we're looking at a program, one of the things we often wonder is what the keys for a certain file are. We've written a small utility that we use from the command line window in SEU (you can get this by pressing F21). When you run the command DSPKEY, it shows the keys for the file on the message line (See 4). The source for the command and the programs it uses is in5, 6, and 7.

When we're looking at a program, one of the things we often wonder is what the keys for a certain file are. We've written a small utility that we use from the command line window in SEU (you can get this by pressing F21). When you run the command DSPKEY, it shows the keys for the file on the message line (See Figure 4). The source for the command and the programs it uses is in Figures 5, 6, and 7.


Show File Keys Utility

Figure 4 Using the DSPKEY Command

 UNABLE TO REPRODUCE GRAPHICS 
Show File Keys Utility

Figure 5 DSPKEY Command Source

 /*==================================================================*/ /* To compile: */ /* */ /* CRTCMD CMD(XXX/DSPKEY) PGM(XXX/KEY002CL) + */ /* SRCFILE(XXX/QCMDSRC) */ /* */ /*==================================================================*/ DSPKEY: CMD PROMPT('Display Keys in a File') PARM KWD(FILE) TYPE(QUAL1) MIN(1) PROMPT('File') QUAL1: QUAL TYPE(*NAME) LEN(10) QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) + SPCVAL((*LIBL)) PROMPT('Library') 
Show File Keys Utility

Figure 6 KEY002CL Source

 /*===============================================================*/ /* To compile: */ /* */ /* CRTCLPGM PGM(XXX/KEY002CL) SRCFILE(XXX/QCLSRC) */ /* */ /*===============================================================*/ KEY002CL: + PGM PARM(&LIBFILE) DCL VAR(&LIBFILE) TYPE(*CHAR) LEN(20) DCL VAR(&FILE) TYPE(*CHAR) LEN(10) DCL VAR(&LIB) TYPE(*CHAR) LEN(10) DCL VAR(&MSG) TYPE(*CHAR) LEN(133) DCL VAR(&TXT) TYPE(*CHAR) LEN(150) DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(80) CHGVAR VAR(&LIB) VALUE(%SST(&LIBFILE 11 10)) CHGVAR VAR(&FILE) VALUE(%SST(&LIBFILE 1 10)) CHKOBJ OBJ(&LIB/&FILE) OBJTYPE(*FILE) AUT(*OBJOPR) MONMSG MSGID(CPF0000) EXEC(DO) RCVMSG MSGDTA(&MSGDTA) MSGID(&MSGID) RTVMSG MSGID(&MSGID) MSGF(QCPFMSG) MSGDTA(&MSGDTA) MSG(&TXT) GOTO CMDLBL(MSG) ENDDO DSPFD FILE(&LIB/&FILE) TYPE(*ACCPTH) OUTPUT(*OUTFILE) + OUTFILE(QTEMP/KEYF) OUTMBR(*FIRST *REPLACE) OVRDBF FILE(QAFDACCP) TOFILE(QTEMP/KEYF) CALL PGM(KEY002RG) PARM(&MSG) DLTOVR FILE(QAFDACCP) CHGVAR VAR(%SST(&TXT 1 10)) VALUE(&FILE) CHGVAR VAR(%SST(&TXT 12 4)) VALUE('KEY:') CHGVAR VAR(%SST(&TXT 17 133)) VALUE(&MSG) MSG: + SNDPGMMSG MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA(&TXT) MSGTYPE(*INFO) ENDPGM 
Show File Keys Utility

Figure 7 KEY002RG Source

 *=============================================================== * To compile: * * CRTRPGPGM PGM(XXX/KEY002RG) SRCFILE(XXX/QRPGSRC) * *=============================================================== *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 FQAFDACCPIP E DISK C *ENTRY PLIST C PARM WKMSG 133 C CAT APKEYF:1 WKMSG 
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: