For Compustat, please see the SAS dataset ' comp.company'.
For CRSP monthly, please see ' crsp.stocknames'.
Those files contain all firms in those databases with their main identifying information.
Note that the CRSP set has every name and ticker used, so it has more than one entry per company. Compustat generally shows only the last or current name used.