Abstract We make a new investigation on the correlation at saturation (subsaturation) density between the density dependence of symmetry energy and the percentage of energy-weighted sum rule (EWSR) exhausted by the pygmy dipole resonances (PDR) in $^{68}$Ni and $^{132}$Sn. The calculations are performed within Skyrme HF (or HF+BCS) plus random phase approximation (RPA) (or quasiparticle RPA) by using SAMi-J effective interactions. The effect of pairing on the dipole strength distribution of $^{68}$Ni and the density dependence of symmetry energy is discussed. The slope parameter L and symmetry energy J at saturation (subsaturation) density are 41.8-90.2 MeV (39.3-64.1 MeV) and 28.0-32.5 MeV (23.0-23.8 MeV). They are consistent with the currently accepted values except for the symmetry energy J at subsaturation density, it is slightly smaller than the data from nuclear mass differences and electric dipole polarizability.