Heparan sulfate (HS), which consists of repeating disaccharide units, plays an essential role in inflammation and viral infections. Heparanase (encoded by the HPSE gene) can cleave the HS chains of heparan sulfate proteoglycans (HSPGs), which are known to be important participants in immune responses. HPSE2 (heparanase 2) is a homologous gene of HPSE. To investigate the functions of HS, which is the primary receptor of the porcine reproductive and respiratory syndrome virus (PRRSV), the two genes involved in the metabolic process of HS were studied. Here, we present a study of tissue expression profiles, polymorphisms of the HPSE and HPSE2 genes, and the changes of their mRNA levels in porcine alveolar macrophages (PAMs) induced by PRRSV. Both genes are preferentially expressed in porcine immune or immune-related organs under normal conditions, e.g., in the lung, spleen, and lymph node. Moreover, a synonymous mutation c.750A>G located in exon5 of the HPSE gene was detected, and was significantly associated with the white blood cell (WBC) count, red blood cell (RBC) count, hemoglobin (HGB), and hematocrit (HCT) in the peripheral blood (p<0.05). A single nucleotide polymorphism (SNP) c.2073A>G was found in the HPSE2 gene and association analysis showed that it was significantly associated with the WBC content in the blood (p<0.05). Upon stimulation in healthy piglets with PRRSV, the HPSE mRNA was obviously up-regulated, while the HPSE2 mRNA did not induce a prominent change in PAMs.