We examine the ordering properties of rectangular hard rods with length L and diameter D at a single planar wall and between two parallel hard walls using the second-virial density functional theory. The theory is implemented in the three-state Zwanzig approximation, where only three mutually perpendicular directions are allowed for the orientations of hard rods. The effect of varying shape anisotropy is examined at / 10, 15 LD and 20. In contact with a single hard wall, the density profiles show planar ordering, damped oscillatory behavior, and wall induced surface ordering transition below the coexisting isotropic density of bulk isotropic-nematic (I-N) phase transition. Upon approaching the coexisting isotropic density, the thickness of nematic film diverges logarithmically, i.e. the nematic wetting is complete for any shape anisotropy. In the case of confinement between two parallel hard walls, it is found that the continuous surface ordering transition depends strongly on the distance between confining walls (H) for HL , while it depends weakly on H for HL . The minimal density at which a surface ordering transition can be realized is located at around ~2 HD for all studied shape anisotropies due to the strong interference effect between the two hard walls. The first order I-N phase transition of the bulk system becomes surface ordered isotropic