It was my first shot as captain of the U.S. Davis Cup team, and to be honest, it did not occur to me that going into the final day of play in Carlsbad, Calif., we could be down two matches to one against Mexico.

But when we lost the doubles the shock set in: we had to win the third and final day's two singles matches to advance in this year's competition.

Our doubles team of Marty Riessen and Sherwood Stewart was actually more dazed than disappointed immediately after a loss to Raul Ramirez and Jorge Lozano in five sets.

Ramirez is a world class player, former winner of the Italian Open and winner of the '77 Grand Prix bonus pool first prize. But Lozano is 17-year-old high school student living with an American family in Palos Verdes, Calif. The combination did not figure to beat us, but strange things often occur in Davis Cup play.

I remember the time in 1965 when I was a member of the U.S. team that lost to Spain. The fans there went berserk; they had never beaten the U.S. before.And right after Jose Arilla and Manuel Santana beat Dennis Ralston and Clark Graebner to clinch the victory, the air was suddenly filled with bits and pieces of everything that wasn't nailed down.

As a substitute in my first outing overseas, I sat stunned yet elated. Growing up black in the U.S. gave me an affinity for any underdog no matter where he lived.

Riessen and Stewart were both tight in their match.Still, their defeat was a surprise. Ramirez beating Roscoe Tanner in the second singles match (tying the competition, 1-1) was not as surprising.

John McEnroe, who won his first singles match, was edgy for the finale. In Cup matches, a player is allowed to speak to his captain only. Since McEnroe is not generally the kind of player who takes bad calls in stride, I had to remind him not to banter with the on-court officials as he does in a tournament. He listened.

Tanner is eminently coachable. I played doubles with Roscoe during his first two years as a pro and I know him and his game well. He always had trouble with Ramirez. But, he is one of only a handful of U.S. players with a real chance of beating Ivan Lendl, who will be our chief opponent during our next quarterfinal Davis Cup match against Czechoslavakia. That will take place July 10-12 at Flushing Meadow in New York City.

Tanner shrugged off his first loss and came back strong and confident to defeat Lozano in three straight sets in the first match on the final Sunday. Afterward, McEnroe likewise disposed of Ramirez, 6-3, 6-4, 6-0, in the fifth match to give the U.S. a 3-2 victory.

Our three victories were all in straight sets and our two losses were both five sets. We came within a hair of winning 5-0.

Barring any unforeseen circumstances, McEnroe and Jimmy Connors will play the singles matches for us against the Czechs. Connors was present as a practice player for four days against Mexico. We could have sold tickets just to watch John and Jimmy play a couple of practice sets. Connors will be making his first Davis Cup appearance in six years.

The doubles presents more of a problem. We have three or four very good teams. The Mayer brothers, Gene and Sandy, are the top team right now. Stan Smith is still nursing a sore arm, so he may be unable to play with Bob Lutz.

And though Peter Fleming may be healthy and ready to play with McEnroe by July, I am a bit reluctant to have McEnroe play all three days if it isn't necessary. Why risk having John get involved in a five-set, no tie breaker (there are no tie breakers in Davis Cup play) doubles match that would leave him tired on Sunday? Mid-July in New York City can be 100 degrees and 65 percent humidity. Besides, he will just have finished playing at Wimbledon the week before.

On the morning before the first day's matches against Mexico, I received a call from George McCall, the 1965 Davis Cup captain during that loss to Spain. He told me, "Now you're going to get gray hairs instead of giving them." And I'm sure a few gray ones did sprout during that time between the doubles loss Saturday and McEnroe's clinching victory.