Created
March 28, 2012 14:01
-
-
Save ccw/2226430 to your computer and use it in GitHub Desktop.
[SAS] Output Dataset as JSON
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment