Base acceleration may be applied either using BOUNDARY_PRESCRIBED_MOTION_NODE with VAD=1, or using LOAD_BODY. For prescribed motion, make sure to use BOUNDARY_SPC to constrain all the other dofs, but leave the relevant dof free at the fixed base, and prescribe the motion on that dof. (In the picture, it seems that the y and z dofs are perpendicular to the beam)
For the output, make sure to give a small output time step for nodout or d3plot to capture the response in high resolution.
In general, you can find several examples here: