bdfp1m1d | Programming Concepts and Reference |
Use this group of functions to:
Format
dft_rec *dfmod(dft_fil *file);
dft_rec *dfmod_all(dft_file file, dft_kyl *mod_list)
dft_rec *dfmod_all_opt(dft_file file, dft_opt options, dft_kyl *mod_list);
dft_rec *dfmod_all_acc(dft_file file, dft_opt access, dft_opt options, dft_kyl *mod_list, dft_xxx acc);
dft_rec *dfmod_all_key(dft_file file, dft_opt options, dft_kyl *mod_list, dft_kyl *key_list);
dft_rec *dfmod_all_acc_key(dft_file file, dft_opt access, dft_opt options, dft_kyl *mod_list, dft_xxx acc, dft_kyl *key_list);
|
The TPFDF product uses the algorithm argument to determine the subfile (ordinal number) that is to be accessed. Specify the algorithm argument based on the type of algorithm that is defined in the DSECT or DBDEF macro for the file. If the DSECT or DBDEF macro defines the #TPFDB04 or the #TPFDB0D algorithm, do not use this parameter.
If the subfile you are accessing is contained in a detail file or intermediate index file defined with the #TPFDBFF algorithm, the TPFDF product uses the algorithm argument to locate the subfile. See TPFDF Database Administration for more information about how the TPFDF product uses the algorithm argument to locate the subfile.
If the file is partitioned or interleaved, specify the relative ordinal number within the partition or interleave. If the file is not partitioned or interleaved, specify the file address compute program (FACE) ordinal number.
See Messages (System Error, Online, Offline) and Master Glossary for more information about these system errors.
Entry Requirements
None.
Normal Return
Error Return
None.
Programming Considerations
The dfmod function sets an indicator in the block to say that it has been changed. The TPFDF product writes this block to DASD when you close or checkpoint the subfile. You must call the dfmod function while the LREC you modified is still current. If you allow the program to read other LRECs in the subfile before you call the dfmod function, some modifications to LRECs can be lost.
Examples
/* set up the search keys */ df_nbrkeys(&select_keylist,3); df_setkey(&select_keylist,1,offsetof(proto_lrec,lrec_id), member_size(proto_lrec,lrec_id),DF_EQ,NULL,X'80', DF_UPORG,DF_CONST); df_setkey(&select_keylist,2,offsetof(proto_lrec,key1), member_size(proto_lrec,key1),DF_EQ,search_key1,0, DF_UPORG,DF_CHAR); df_setkey(&select_keylist,3,offsetof(proto_lrec,key2), member_size(proto_lrec,key2),DF_EQ,search_key2,0, DF_UPORG,DF_CHAR); /* activate the search key list */ dfkey(file_ptr,&select_keylist); /* set up the modify keys */ df_nbrkeys(&mod_keylist,2); df_setkey_mod(&mod_keylist,1,offsetof(proto_lrec,field1), member_size(proto_lrec,field1),modify_val1,0, DF_ADD_SHORT); df_setkey_mod(&mod_keylist,2,offsetof(proto_lrec,field2), member_size(proto_lrec,field2),0,modify_val2, DF_MVI); /* Modify all LRECs matching the established criteria */ dfmod_all_opt(file_ptr,DFMOD_BEGIN,&mod_keylist);
lrec_ptr = dfred_nbr(file,DFRED_LRECNBR, 0,5); memset(&mod_keylist, 0x00,74); mod_keylist.sw01nky = 1; mod_keylist.kit[0].sw01dis = 8; mod_keylist.kit[0].sw01len = 2; mod_keylist.kit[0].sw01sea = empname; mod_keylist.kit[0].sw01id2 = DF_MVC; lrec_ptr = dfmod_all(file,&mod_keylist);
Related Functions