News
Abstract
RPG enhancement for the %KDS built-in function with PTFs for 7.3 and 7.4.
Content
You are in: RPG Cafe > Spring 2020: %KDS allows a variable number of keys
Short URL: https://ibm.biz/rpgcafe_kds_bif_var_num_keys
RPG Cafe: %KDS(ds : var_num_keys)
You can now specify a variable for the second parameter of %KDS.
PTFs for 7.3 and 7.4, available in May 2020.
7.3:
- ILE RPG compiler: SI73190
- ILE RPG runtime: SI73189
7.4:
- ILE RPG compiler: SI73192
- ILE RPG runtime: SI73191>
- ILE RPG compiler, TGTRLS(V7R3M0): SI73193
The PTFs are also available with the Db2 for i Fix Packs of 15 May 2020. See Db2 for IBM i 2020 PTF Group Schedule.
Details
Variable number of keys for %KDS
Formerly, if you wanted to limit the number of keys used by %KDS, you had to specify a constant.
Before: DCL-DS keys EXTNAME('MYFILE' : *KEY) END-DS; DCL-S num_keys INT(10); SELECT; WHEN num_keys = 1; CHAIN %KDS(keys : 1) MYFILE; WHEN num_keys = 2; CHAIN %KDS(keys : 2) MYFILE; ... ENDSL;
Now, you can specify a variable.
After: DCL-DS keys EXTNAME('MYFILE' : *KEY) END-DS; DCL-S num_keys INT(10); CHAIN %KDS(keys : num_keys) MYFILE;
RDi support
The next release of RDi will support this enhancement.
Documentation in the IBM Knowledge Center
The ILE RPG Reference and ILE RPG Programmer's Guide in the 7.3 and 7.4 IBM Knowledge Center are updated with full information about this enhancement. Start at the What's New Since 7.3 or What's New Since 7.4 section in the Reference.
- 7.3 Reference: What's new since 7.3: https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzasd/rpgrelv7r3post.htm
- 7.4 Reference: What's new since 7.4: https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/rzasd/rpgrelv7r4post.htm
Was this topic helpful?
Document Information
Modified date:
15 May 2020
UID
ibm16120945