BTEQ export to Flat file

Database
Enthusiast

BTEQ export to Flat file

Hi,

Iam trying to export data to flat file which needs to be sent as email to everyone.

Iam having difficulty in getting the alignment of the header and the data

Currently Iam getting the email like below .Can anyone help me on how to generate a email report

--DATABASENAME-------OLDMAXPERMSPACEVALUE-----SPACEUSEDPRCNT-----SPACEALLOCATEDFROMSYSDBA

CUST_D_CORE           1803886264080         63.67                           360777252816        

BTEQ export script

select '--DATABASENAME-------OLDMAXPERMSPACEVALUE-----SPACEUSEDPRCNT-----SPACEALLOCATEDFROMSYSDBA';

select ' ';

select ' ';

SELECT

   CAST(DATABASENAME AS VARCHAR(20))

  ,TRIM(MAXPERMSPACEVALUE)  AS OLDMAXPERMSPACEVALUE

  ,TRIM(SPACEUSEDPRCNT)

   ,TRIM(SPACEALLOCQNTY)

   FROM

  SYSDBA.GT_MOVESPACE

  GROUP BY 1,2,3,4;