Hi, I am writing to JSON file using SAS dataset as input using below code: data _null_; file _webout PS=32767 ; set &indata end=lastrec; put ' "header":{' /; /*header starts*/ %do i = 1 %to 14; put ' "' @; put "%trim(&&var&i)"@; put '":"'@; put &&var&i '",'; %end; put ' "' @; put "%trim(&&var15)"@; put '":"' &&var15'"'; put ' },' /; /*header ends*/ run; In the output message, it puts and extra space for variable value when writing to file. Please see output file below: "header":{ "senderMessageId":"senderMessageId ", "senderMessageName":"getDecision ", "versionNumber":"1 ", "sequenceNumber":"1 ", "senderMessageIdEcho":" ", "sessionId":"16f526829a0f48f29a6a144d2f1bcd9d ", "creationTimeStamp":"01JAN60:00:00:00 ", "senderApplicationId":"ZT ", "senderSubApplicationId":" ", "senderHostName":"eai-CDEV.com ", "billingAU":". ", "customerId":"12345 ", "teamMemberId":" ", "environment":"CDEV ", "applicationId":" " }, I do not need this extra space at end of value for each variable value. Also, it puts two spaces for blank character variables, I do not need that. I want nothing to be written to file when character or numeric variable is missing. Please help on this if someone has faced similar issue. Thanks!
... View more