IBM Crypto Education Community

IBM Crypto Education Community

IBM Crypto Education Community

Join the IBM Crypto Education community to explore and understand IBM cryptography technology. This community is operated and maintained by the IBM Crypto Development team.

 View Only

Rexx Sample: CKDS & PKDS Record Count

By Eysha Shirrine Powers posted Wed March 25, 2020 05:28 PM

  

/* Rexx */

/*-------------------------------------------------------------------*/
/* Description:                                                      */
/*                                                                   */
/* This REXX contains a sample that shows how to count records in    */
/* the CKDS and PKDS                                                 */
/*                                                                   */
/* How To Run:                                                       */
/* - Execute this script from TSO                                    */
/*   (e.g. EX 'HLQ.MLD.LLQ(COUNTRC2)')                               */
/*-------------------------------------------------------------------*/

/*********************************************************************/
/* List the record counts                                            */
/*********************************************************************/

kdsl_rule_array_count    = '00000003'x;
kdsl_rule_array          = 'CKDS    COUNT   ALL     ';
Call CSFKDSL;

say "CKDS record count: " c2d(kdsl_label_count);

kdsl_rule_array_count    = '00000003'x;
kdsl_rule_array          = 'PKDS    COUNT   ALL     ';
Call CSFKDSL;

say "PKDS record count: " c2d(kdsl_label_count);

say "-----------------------------------------------------------------"
say "End of Sample"
say "-----------------------------------------------------------------"

exit;

/* --------------------------------------------------------------- */
/* CSFKDSL - Key Data Set List                                     */
/*                                                                 */
/* Generates a list or count of CKDS and PKDS labels or TKDS       */
/* object handles.                                                 */
/*                                                                 */
/* See the ICSF Application Programmer's Guide for more details.   */
/* --------------------------------------------------------------- */
CSFKDSL:
kdsl_rc = 'FFFFFFFF'x;
kdsl_rs = 'FFFFFFFF'x;
kdsl_exit_data_length    = '00000000'x;
kdsl_exit_data           = '';
kdsl_label_filter_length = '00000000'x;
kdsl_label_filter        = '';
kdsl_search_crit_length  = '00000000'x;
kdsl_search_crit         = '';
kdsl_label_count         = '00000000'x;
kdsl_output_list_length  = '00000000'x;
kdsl_output_list         = '';
kdsl_reserved1_length    = '00000000'x;
kdsl_reserved1           = '';
kdsl_reserved2_length    = '00000000'x;
kdsl_reserved2           = '';
kdsl_continuation_area   = '';

ADDRESS LINKPGM "CSFKDSL",
                "kdsl_rc"                     "kdsl_rs"            ,
                "kdsl_exit_data_length"       "kdsl_exit_data"     ,
                "kdsl_rule_array_count"       "kdsl_rule_array"    ,
                "kdsl_label_filter_length"    "kdsl_label_filter"  ,
                "kdsl_search_crit_length"     "kdsl_search_crit"   ,
                "kdsl_label_count"                                 ,
                "kdsl_output_list_length"     "kdsl_output_list"   ,
                "kdsl_reserved1_length"       "kdsl_reserved1"     ,
                "kdsl_reserved2_length"       "kdsl_reserved2"     ,
                "kdsl_continuation_area";

if (KDSL_RC /= '00000000'x) Then
  say 'KDSL Failed   (rc=' c2x(KDSL_RC)' rs='c2x(KDSL_rs)')' ;

return;

0 comments
5 views

Permalink