Hello,
I would like to find a way to automatically create the json file header below:
{"transactionMeta":{"batchId":"BT_10VriPO92D6e9NF", "fields":[ "distributor", "transactionDate", "transactionType", "customerTenure", "policyNumber", "policyType", "cntrct_ref_nbr", "dim_pl_cntrct_ver_key", "productHolding", "agentId", "agentEmployeeNbr", "agentName", "agentEmail", "agentManager", "managerEmail", "agentTeamCd", "agentHireDt" ]},"contacts":[
The "batchId":"BT_10VriPO92D6e9NF" is put into a macro variable using a proc http call followed by call symputx('BatchId',id,'g') . The "contacts":[ could be also put into a macro variable.
It remains the fields portion:
"fields":[ "distributor", "transactionDate", "transactionType", "customerTenure", "policyNumber", "policyType", "cntrct_ref_nbr", "dim_pl_cntrct_ver_key", "productHolding", "agentId", "agentEmployeeNbr", "agentName", "agentEmail", "agentManager", "managerEmail", "agentTeamCd", "agentHireDt" ]
So is there a way to automatically generate the header based on the sample data below:
{"firstName":"Gustave1","lastName":"Karma1","email":"someone@hotmail.com","extRef":"12345678-1234-MNOP-1234-ABCDEFGHIJKL","language":"FR","embeddedData":{"appLoginInd":"N","ubiStatus":"NO UBI","postalCode":"H0H 0H0","provinceCode":"QC"},"transactionData":{"distributor":"BEL","transactionDate":"2023-01-19","transactionType":"QUOAUTO","customerTenure":0,"policyNumber":"10000001","policyType":"AUP","cntrct_ref_nbr":11111101,"dim_pl_cntrct_ver_key":10000001,"productHolding":"AUP","agentId":"RRRRRR01","agentEmployeeNbr":"777701","agentName":"mr1 unknow1","agentEmail":"someone@hotmail.com","agentManager":"Mg1 Audi","managerEmail":"someone@hotmail.com","agentTeamCd":"AAAA1","agentHireDt":"2021-10-18"}},
{"firstName":"Gustave10","lastName":"Karma10","email":"someone@hotmail.com","extRef":"12345678-1234-MNOP-1234-ABCDEFGHIJKL","language":"EN","embeddedData":{"appLoginInd":"Y","ubiStatus":"FORMER UBI","postalCode":"H0H 0H0","provinceCode":"QC"},"transactionData":{"distributor":"BEL","transactionDate":"2023-01-18","transactionType":"AUTOMOD","customerTenure":11,"policyNumber":"10000010","policyType":"AUP","cntrct_ref_nbr":11111110,"dim_pl_cntrct_ver_key":10000010,"productHolding":"AUP","agentId":"RRRRRR10","agentEmployeeNbr":"777710","agentName":"mr10 unknow10","agentEmail":"someone@hotmail.com","agentManager":"Mg10 Audi","managerEmail":"someone@hotmail.com","agentTeamCd":"AAAA10","agentHireDt":"2022-06-13"}}]}
... View more