-
Notifications
You must be signed in to change notification settings - Fork 52
/
Print Sample (final).step
1 lines (1 loc) · 5.76 KB
/
Print Sample (final).step
1
{"creationTimeStamp":"2024-07-11T22:47:21.544Z","modifiedTimeStamp":"2024-07-12T20:27:20.305Z","createdBy":"student","modifiedBy":"student","name":"Print Sample (final).step","displayName":"Print Sample (final).step","localDisplayName":"Print Sample (final).step","properties":{},"links":[{"method":"GET","rel":"self","href":"/dataFlows/steps/0bd7eb03-aa36-47bb-8e84-66531242ad65","uri":"/dataFlows/steps/0bd7eb03-aa36-47bb-8e84-66531242ad65","type":"application/vnd.sas.data.flow.step"},{"method":"GET","rel":"alternate","href":"/dataFlows/steps/0bd7eb03-aa36-47bb-8e84-66531242ad65","uri":"/dataFlows/steps/0bd7eb03-aa36-47bb-8e84-66531242ad65","type":"application/vnd.sas.data.flow.step.summary"},{"method":"GET","rel":"up","href":"/dataFlows/steps","uri":"/dataFlows/steps","type":"application/vnd.sas.collection","itemType":"application/vnd.sas.data.flow.step.summary"},{"method":"PUT","rel":"update","href":"/dataFlows/steps/0bd7eb03-aa36-47bb-8e84-66531242ad65","uri":"/dataFlows/steps/0bd7eb03-aa36-47bb-8e84-66531242ad65","type":"application/vnd.sas.data.flow.step","responseType":"application/vnd.sas.data.flow.step"},{"method":"DELETE","rel":"delete","href":"/dataFlows/steps/0bd7eb03-aa36-47bb-8e84-66531242ad65","uri":"/dataFlows/steps/0bd7eb03-aa36-47bb-8e84-66531242ad65"},{"method":"POST","rel":"copy","href":"/dataFlows/steps/0bd7eb03-aa36-47bb-8e84-66531242ad65/copy","uri":"/dataFlows/steps/0bd7eb03-aa36-47bb-8e84-66531242ad65/copy","responseType":"application/vnd.sas.data.flow.step"},{"method":"GET","rel":"transferExport","href":"/dataFlows/steps/0bd7eb03-aa36-47bb-8e84-66531242ad65","uri":"/dataFlows/steps/0bd7eb03-aa36-47bb-8e84-66531242ad65","responseType":"application/vnd.sas.transfer.object"},{"method":"PUT","rel":"transferImportUpdate","href":"/dataFlows/steps/0bd7eb03-aa36-47bb-8e84-66531242ad65","uri":"/dataFlows/steps/0bd7eb03-aa36-47bb-8e84-66531242ad65","type":"application/vnd.sas.transfer.object","responseType":"application/vnd.sas.summary"}],"metadataVersion":0.0,"version":2,"type":"code","flowMetadata":{"inputPorts":[{"name":"Table","displayName":"Table","localDisplayName":"Table","minEntries":1,"maxEntries":1,"defaultEntries":0,"type":"table"}],"outputPorts":[]},"ui":"{\n\t\"showPageContentOnly\": true,\n\t\"pages\": [\n\t\t{\n\t\t\t\"id\": \"Data\",\n\t\t\t\"type\": \"page\",\n\t\t\t\"label\": \"Data\",\n\t\t\t\"children\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"Table\",\n\t\t\t\t\t\"type\": \"inputtable\",\n\t\t\t\t\t\"label\": \"Select input table:\",\n\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\"placeholder\": \"\",\n\t\t\t\t\t\"visible\": \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"varlist\",\n\t\t\t\t\t\"type\": \"columnselector\",\n\t\t\t\t\t\"label\": \"Select columns to print:\",\n\t\t\t\t\t\"include\": null,\n\t\t\t\t\t\"order\": false,\n\t\t\t\t\t\"columntype\": \"a\",\n\t\t\t\t\t\"max\": null,\n\t\t\t\t\t\"min\": null,\n\t\t\t\t\t\"visible\": \"\",\n\t\t\t\t\t\"table\": \"Table\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"Options\",\n\t\t\t\"label\": \"Options\",\n\t\t\t\"type\": \"page\",\n\t\t\t\"children\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"numRows\",\n\t\t\t\t\t\"type\": \"numstepper\",\n\t\t\t\t\t\"label\": \"Number of rows to print:\",\n\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\"integer\": true,\n\t\t\t\t\t\"min\": 1,\n\t\t\t\t\t\"max\": null,\n\t\t\t\t\t\"stepsize\": 5\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"selection\",\n\t\t\t\t\t\"type\": \"radiogroup\",\n\t\t\t\t\t\"label\": \"Selection method:\",\n\t\t\t\t\t\"items\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"FIRST\",\n\t\t\t\t\t\t\t\"label\": \"First N rows\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"RANDOM\",\n\t\t\t\t\t\t\t\"label\": \"Random sample\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"visible\": \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"rsMethod\",\n\t\t\t\t\t\"type\": \"dropdown\",\n\t\t\t\t\t\"label\": \"Rnadom sample method:\",\n\t\t\t\t\t\"items\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"SRS\",\n\t\t\t\t\t\t\t\"label\": \"Simple random sample (without replacement)\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"URS\",\n\t\t\t\t\t\t\t\"label\": \"Unrestricted random sample (with replacement)\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\"placeholder\": \"\",\n\t\t\t\t\t\"visible\": [\n\t\t\t\t\t\t\"$selection\",\n\t\t\t\t\t\t\"=\",\n\t\t\t\t\t\t\"RANDOM\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"syntaxversion\": \"1.3.0\",\n\t\"values\": {\n\t\t\"Table\": {\n\t\t\t\"library\": \"SASHELP\",\n\t\t\t\"table\": \"HOMEEQUITY\"\n\t\t},\n\t\t\"varlist\": [],\n\t\t\"numRows\": 20,\n\t\t\"selection\": {\n\t\t\t\"value\": \"FIRST\",\n\t\t\t\"label\": \"First N rows\"\n\t\t},\n\t\t\"rsMethod\": {\n\t\t\t\"value\": \"SRS\",\n\t\t\t\"label\": \"Simple random sample (without replacement)\"\n\t\t}\n\t}\n}","templates":{"SAS":"/* Selection options are FIRST (first rows) or RANDOM (random sample) */\n\n/* GET TOTAL ROW COUNT FROM TABLE */\n\t\n\tproc sql noprint;\n\t select count(*) format=comma15. into :N from &table;\n\tquit;\n\n/* SELECT FIRST &numRows ROWS */\n%if &selection=FIRST %then %do;\n\ttitle1 color=\"#545B66\" \"Sample from &table\";\n\ttitle2 height=3 \"First &numRows of &N Rows\";\n\tdata sample;\n\t set &table(obs=&numRows keep=&varlist);\n\trun;\n%end;\n\n/* SELECT RANDOM SAMPLE OF &numRows ROWS */\n\n%else %do;\n\ttitle1 color=\"#545B66\" \"Sample from &table\";\n\ttitle2 height=3 \"Random Sample &numRows of &N Rows\";\n\t\n\tproc surveyselect data=&table(keep=&varlist) \n\t method=&rsMethod n=&numRows\n\t out=sample noprint;\n\trun; \n%end; \n\n/* PRINT SAMPLE */\n\n\tfootnote height=3 \"Created %sysfunc(today(),nldatew.) at %sysfunc(time(), nltime.)\";\n\tproc print data=sample noobs;\n\trun;\n\ttitle;\n\tfootnote;\n/* SAS templated code goes here */"}}