Dear Sir/Madam,

I am doing the research on commercial jet aircraft, and each sample has "lease start date" and "lease end date". Using these data, I would like to transform the dataset into panel data. Is there any command which can be used for?
ID Type Lease End Lease Start
A 737-800 2022/12/31 2017/1/1
B 777-300ER    
C A320    
 ↓
ID Type Lease End Lease Start Year Lease
A 737-800 2022/12/31 2017/1/1 2017 1
        2018 1
        2019 1
        2020 1
        2021 1
        2022 1
        2023 0
Best regards,
Mayuko Kimura