SQL Services contro le API

api_fiorePossiamo fare a meno delle API di IBMi e utlizzare i servizi DB2 for i ?

Così ci dicono Susan Gantner e Jon Paris nel loro articolo

Replacing API Calls With DB2 for i Services

Negli ultimi aggiornamenti della 7.1 e 7.2 IBM continua a regalarci nuovi DB2 for i Services assolutamente interessanti …

Vediamo qualche esempio che prima di questi servizi che ci permettono di ottenere informazioni di sistema senza ricorrere all’uso della API che non è mai stato molto semplice :

 

Eval-Corr copy and manage DS

 

coollogo_com-247503328Eval-Corr … what is this ? I found it reading an italian forum where great Mr. Obelix suggest this operation code to solve ad problem with DS (see original message at http://it.comp.as400.narkive.com/Dx0ArfSk/campi-numerici-contenenti-blanks).

Googling for Eval-Corr I learn something new:

IBM manual says:

The EVAL-CORR operation assigns data and null-indicators from the corresponding subfields of the source data structure to the subfields of the target data structure. The subfields that are assigned are the subfields that have the same name and compatible data type in both data structures. For example, if data structure DS1 has character subfields A, B, and C, and data structure DS2 has character subfields B, C, and D, statement

EVAL-CORR DS1 = DS2

will assign data from subfields DS2.B and DS2.C to DS1.B and DS1.C

Eval-Corr valorizzare parzialmente una DS

coollogo_com-247503328

Veniamo all’operation code Eval-Corr:

Il manuale IBM dice:

The EVAL-CORR operation assigns data and null-indicators from the corresponding subfields of the source data structure to the subfields of the target data structure. The subfields that are assigned are the subfields that have the same name and compatible data type in both data structures. For example, if data structure DS1 has character subfields A, B, and C, and data structure DS2 has character subfields B, C, and D, statement

EVAL-CORR DS1 = DS2

will assign data from subfields DS2.B and DS2.C to DS1.B and DS1.C