# How to download only amex and nyse data from CRSP?

I am a beginner and I have a very elementary question, but I don't know where to find the answer!

I am downloading the CRSP monthly stock files for 20 years. I want to have only AMEX and NYSE stocks. But I think CRSP has all stocks including NASDAQ. How can I keep only NYSE and AMEX and delete any other markets from the data? Is there any indicator which shows which stock is traded in which market?

On the CRSP database, for each stock there is a field called EXCHCD. This field will indicate you the exchange. Here are the exchange codes: