Dear Guodong, actually you can get these two in a single shot.By setting LOPTICS=.TURE. in the INCAR file, you can obtain frequency dependent real and imaginary part of the dielectric function. For static dielectric function .i.e. at 0 frequency you can take only first value. The whole data can be found in OUTCAR file.
Thanks @Dimple Sharma, I have tried that, But it is not easy to get the epsilon at infinite frequency. I discussed with my colleague, and we think it can be done using DFPT in Vasp, and the two kinds of dielectric constants can be given. Vasp gives the two contributions from electrons and ions. The summation of the two should be the static dielectric constant. The only contribution of electrons should be the infinite-omega dielectric constant.
Because at static electric field, electrons and ions can follow the field and contribute together. But at infinite-omega electric field, only electron gives contribution, and the ions can not follow due to the very big mass and the average value should be zero.