Dear Statalist,

Suppose you have the following dataset:
City_1 City_2 Flow Pair_ID
AAA BBB 456 1
AAA CCC 21 2
AAA DDD 342 3
BBB AAA 321 1
BBB DDD 65 4
CCC AAA 244 2
How would you go on to generate the variable 'Pair_ID', it is a unique identifier for every pair regardless of the order (if the flow from City_1 goes to City_2 or viceversa). Note that the dataset is not symmetric, hence, there could be flow from XXX to YYY but not from YYY to XXX.

Thanks in advance!