/ Published in: SAS
SAS code to output in JSON format
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
LIBNAME EDA ORACLE PATH=XE SCHEMA=EDA USER=eda PASSWORD=eda; DATA WAT; SET EDA.WAT; KEEP PRODUCT_NAME SPEC_FILE LOT_ID WAFER_ID SITE_ID ATT1 ATT2 ATT3; WHERE LOT_ID like 'P0M78.1'; RUN; DATA _NULL_; file print PS=32767; set WAT end=lastrec; if _N_ eq 1 then do; put '['; end; put '{"productName":"' PRODUCT_NAME '",'; put '"lotId":"' LOT_ID '",'; put '"waferId":' WAFER_ID ','; put '"siteId":"' SITE_ID '",'; put '"specFile":"' SPEC_FILE '",'; put '"attrs": ['; put '{"attr1":' ATT1 '},'; put '{"attr2":' ATT2 '},'; put '{"attr3":' ATT3 '}]}'; if lastrec eq 1 then do; put ']'; end; else do; put ','; end; RUN;