Exhibit 5.1 [LETTERHEAD OF ALSTON & BIRD LLP APPEARS HERE] October 28, 1997 National Data Corporation National Data Plaza Atlanta, Georgia 30329-2010 Re: Registration Statement on Form S-4 Covering a Maximum of 1,059,829 Shares of Common Stock Registration No. 333-35991 ------------------------------------------- Ladies and Gentlemen: This opinion is being rendered in connection with that certain Stock Purchase Agreement, dated as of August 20, 1997 (the "Stock Purchase Agreement"), by and among PMSI Database Holdings, Inc. ("PMSI Database"), a wholly-owned subsidiary of Pharmaceutical Marketing Services, Inc. ("PMSI"), PMSI, and National Data Corporation (the "Company"), in which the Company will issue up to 1,059,829 shares of its $.125 par value per share common stock (the "Shares"), upon the terms and conditions set forth in its Registration Statement on Form S-4 (the "Registration Statement"), as filed by the Company with the Securities and Exchange Commission under the Securities Act of 1933, as amended, on September 19, 1997 as amended. As counsel for the Company, we have examined such corporate records and documents as we have deemed relevant and necessary as the basis for this opinion, and we are familiar with the actions taken by the Company in connection with the authorization, registration, issuance, and sale of the Shares. Based upon the foregoing, it is our opinion that the Shares will, upon their issuance in accordance with the terms and conditions set forth in the Stock Purchase Agreement, be duly authorized and validly issued, fully paid and non-assessable under the Delaware General Corporation Law as in effect on this date. We hereby consent to the use of this opinion as an exhibit to the Registration Statement and the reference to our firm in the section entitled "Legal Matters." Very truly yours, ALSTON & BIRD LLP By: /s/ Joel J. Hughey --------------------------------