Bjorn Borg and Guillermo Vilas, who are seeded to meet next weekend in the semifinals, survived rough going today in advancing to the fourth round at the U.S. Open tennis championship at the National Tennis Center in Flushing Meadows.

Borg, playing his obligatory match under the floodlights he despises, beat Peter McNamara, a hard-hitting Australian best known for his doubles success with countryman Paul McNamee, 7-6, 1-6, 6-2, 6-0.

Vilas -- who won the Open on clay in 1977, the last year it was played at nearby Forest Hills, but has not reached the quarterfinals in the two years the tournament has been played on the asphalt-based hard courts here -- lost the first two sets in a midafternoon sleepwalk, but recovered to beat Francisco Gozalez, 3-6, 3-6, 6-4, 6-4, 6-2.

The defending women's champion, Tracy Austin, also had her shaky moments, trailing, 1-4, and two service breaks in the first set, but then eliminated left-hander Sylvia Hanika of West Germany, 6-4, 6-4.

Chris Evert Lloyd, who monopolized the Open title for four years before Austin dethroned her in last year's final, routed Wendy White, 6-1, 6-1, in the opening stadium match of a sold-out day session that drew a record crowd of 20,409.

Evert, who has lost only six games in three matches so far, said "there is no part of my game I am not pleased with, but I do need to have more tough matches. Whoever is more match tough and in condition is going to win. I don't want to have my first tough match in the semis . . . It could be a shock to my system."

Evert is seeded to meet Austin in the semis, but the 17-year-old reigning champ is in the toughest quarter of the draw. She next will play Virginia Ruzici, a 6-2, 2-6, 6-3 victor over Pan Teeguarden today, and the winner of that match will face the survivor of a tough fourth-rounder between Dianne Fromholtz and Pam Shriver of Luthersville, Md.

Fromholtz, seeded sixth but struggling to regain her form after a tonsilectomy, today crunched Susan Leon, 6-0, 6-2. Shriver, 18, the 1978 runner-up who is climbing back toward the top of her game after a shoulder injury that she says "made and made some outstanding volleys me a wreck last year," served well in beating Bettina Bunge, 6-3, 6-3.

Several times Bunge got to the net, only to be beaten by reflex lob volleys by the six-foot Shriver on key points. Several times she hit passing shots that seemed untouchable, only to have the stork-like Shriver intercept them with sure, long-armed volleys.

Borg, the five-time French Open and Wimbeldon champion who is favored to win his first Open title was far from his best in the first two sets. He made so many uncharacteristic errors that the evening crowd of 11,487 must have wondered briefly if his dreams of nailing down the third leg of the elusive French-Wimbledon-U.S. Australian Grand Slam would disappear into the night, as they did last year when Borg lost a floodlit quarterfinal to Roscoe Tanner.

McNamara -- reigning Australian, WCT and Wimbeldon and doubles champ with McNamee, but only No. 51 in the computerized world singles rankings -- came out lashing the ball with the abandon of a man with nothing to lose.

McNamara led, 4-1, in the first set, but Borg caught up at 4-4 and won the seat in a tie breaker, 7-2, including four of five points on McNamara's serve.

Instead of folding and fading away, however, McNamara kept whaling the ball hard and deep, looking for opportunities to get to the net. He played with an elan that excited the crowd.

Borg lost his serve three times in a row from 1-1 in the third set, as wispers of anticipation alternated in the stands with squeals of delight for hotly contested points.

Borg broke McNamara twice to take a 3-0 lead in the third set though, and after playing one more loose game to lose his serve for 3-1, he played the kind of tennis that distinguishes him as the world's best player.

Borg next plays Yannick Noah -- a 4-6, 6-2, 6-4, 6-4 victor today over acrobatic Mel Purcell -- and could then meet Roscoe Tanner tonight beat Californian Erik van Dillen, 7-, 6-1, 6-2.