2 options, buy the new line and splice the shackles on (assuming the originals are still OK. Yo uca nbuy the line from West Marine, D&R or I think this (Sailboatowners.com) web site has line.
If you aren't confident in your splicing abilities, Rudy at D&R will sell you new. pre-made (by him) halyards, the disadvantge is they come with the shackles since there isn't a way to get the shackles on after the splice with out modifying the shackles. Also, paying Rudy (or anyone else... not trying to pick on Rudy!) to do those 2 splices will cost more than hte cost of the tools to make the slices yourself. Instructions are on-line at either the New England Ropes website or the Sampson Ropes website. Other brands may also have instructions, just be sure that the intructions match the brand of tool (Fid) that you use. The process is basically the same, but technique varies slightly by Fid brand.
If you go to a local rope supplier (Marine Store?) they probably could just copy your old halyards and splice on the shackles, or may know a local person who does splicing for people, cost may be $10-12 for each splice.
For your 1977 O'DAY 22 the Main Halyard is 46' 7" and the jib halyard is 46' 4". Both are 5/16" diam. You want Dacron (polyester) double-braid.
If you are going to splice the shackles on yourself, I'd plan on buying about 2-3' extra line........ in case you need to cut off your first try at splicing (experience is best teacher......and if the halyard is too long....well it can be shortened ,but you can't make it longer once line is cut!)