I am working to export a SAS dataset into a specific JSON format due to the system requirements that will be reading the JSON. When I use PROC JSON out='\\Output Data\File_202207' pretty;
EXPORT CME_final;
run; it exports as this: { "SASJSONExport": "1.0 PRETTY", "SASTableData+CME_final": [ { "type":"Agency" "value": 28, "Client": "99999", "Type": "ohr_initial", "Start Date": "07/29/2022 09:00:00 AM", "End Date": "07/29/2022 09:00:00 AM", "Duration (hh:mm)": "0", "Diagnosis Treated": "XXX", "NPI": "9999999999", "Completed By": "99999", "Place of Service Code": "11", "Is Telehealth": "1", "Service Track": "", "ProgramProvidingService": "ohrs", "Program Enrollment": "", "Facility Providing Service": "25", "Is Initial Contact?": "0", "Is Crisis": "0", "Discharge Planning": "0", "Activity Type": "Phone Call", "Portal ID": "de839c8c-1b61-4c68-907f-652c3c99b00a" } ] } The system I am working with has indicated the format needs to look like this where "type":"variable Name", "value":"variable value" is there for every entry { "method":"startautomation", "methodParameters":[ { "type":"IS_API_CALL", "value":"1" } ], "automationKey":"ohr", "version":"2.0", "detail":[ { "id":null, "foreignKeyID":null, "action":"ADD", "keyValue":null, "data":[ { "type":"Agency", "value":"28" }, { "type":"Client", "value":"99999" }, { "type":"Type", "value":"ohr_initial" }, { "type":"Start Date", "value":"07/05/2022 09:00:00 AM" }, { "type":"End Date", "value":"07/05/2022 09:00:00 AM" }, { "type":"Duration (hh:mm)", "value":"0" }, { "type":"Diagnosis Treated", "value":"XXX" }, { "type":"Completed By", "value":"99999" }, { "type":"Place of Service Code", "value":"11" }, { "type":"Is Telehealth", "value":"1" }, { "type":"Service Track", "value":"" }, { "type":"Program Providing Service", "value":"ohrs" }, { "type":"Program Enrollment", "value":"" }, { "type":"Facility Providing Service", "value":"25" }, { "type":"Is Initial Contact?", "value":"0" }, { "type":"Is Crisis", "value":"0" }, { "type":"Discharge Planning", "value":"0" }, { "type":"Activity Type", "value":"Face to Face" }, { "type":"Portal ID", "value":"2a229325-e425-402c-a760-bfefa354b1cb" } ], "subData":[ ] } ] } Is there a way in SAS to include the "type" and "value" specifications? I have done a lot of reading and scouring the internet but haven't found an example like this... Thanks in advance for your help!
... View more