selik / xport

Python reader and writer for SAS XPORT data transport files.
MIT License
49 stars 24 forks source link

SAS metadata Length #68

Closed kennest closed 3 years ago

kennest commented 3 years ago

Please anyone know how to set the Length metadata on a column : for k, v in ds.items(): for i,n in sdtm_specs.iterrows(): if k == n['Variable Name']: v.label=n['Label'] v.length=n['Length'] if v.dtype == 'object': v.format = '$CHAR20.' else: v.format = '10.2'

selik commented 3 years ago

Isn't the $CHAR20. format setting the length to 20? What do you mean by the length?

kennest commented 3 years ago

Isn't the $CHAR20. format setting the length to 20? What do you mean by the length?

I made a mistake, to set the length we need to use v.width instead of v.length. Thx