lexjansen / dataset-json-sas

Dataset-JSON SAS Implementation
MIT License
15 stars 7 forks source link

Suggestion/wish: combine some SAS code for both ADaM and SDTM as macros instead of two different pieces of code. #16

Closed mhungria closed 12 months ago

mhungria commented 12 months ago

Suggestion/wish: combine some SAS code for both ADaM and SDTM as macros instead of two different pieces of code. Refs: 02_create_metadata_from_definexml.sas and 05_compare_data.sas

lexjansen commented 12 months ago

For 05_compare_data.sas I can see this, as the parameters could be baselib and complib, without having to specify the dataset. For 02_create_metadata_from_definexml.sas I'm not so sure, since the %CreateMetadataFromDefineXML macro already specifies the Define-XML file and the output library. The datastep after this macro call is really hardcoded. I'm not sure what macro signature you envision.

mhungria commented 12 months ago

i.e., %macro ManualUpdates(metadatalib=);

lexjansen commented 12 months ago

The code would be very specific for specific SDTM or ADaM study datasets, so I do not see how this could be generic.

mhungria commented 12 months ago

Since the main reason I separated the update of the keys into the 02_create_metadata_from_definexml.sas was to include it as a “manual adjustment”, I combined all manual adjustments as a macro and controlled it with the metadata lib indicated as a macro parameter. In case there may be other manual adjustments needed, having a unique place to adjust in the code is simpler. In any case, no need to follow the same if you don't foresee other manual adjustments.

lexjansen commented 12 months ago

As this is would not be a generic macro, I decided not to implement. The manual adjustments were just a example. They may be different between different standards.