Green’s Dictionary of Slang

bag n.2

[used in 1930s to refer to an actual bag used to hold bootleg liquor and in 1940s–50s to that which held narcotics, bag took on its abstract (and still current) meaning in the 1960s; Gold, A Jazz Lexicon (1964), suggests link to bag of tricks]
[1960s+] (orig. US black)

1. taste, disposition, attitude, occupation, preference, way of life.

2. one’s preferred drug.

In phrases

come out of a bag (v.)

1. [1930s] (US black) to act in an obnoxious manner.

2. [1990s+] to act contrary to expectations, to behave illogically in a given situation.

get one’s own bag going (v.)

[1960s] (US campus) to pursue one’s own interests.

have a bag (v.)

[1960s–70s] (US black) to have a problem; thus have a bag and a half, to have a very great problem.