Although @JacksonChen 's answer is a much easier to implement and likely a better solution for most use cases, I also wanted to add in another option for reference (just in case it fits better for someone's use case).
You can accomplish a DE clear via the SOAP API utilizing a Perform Request on the DataExtension Object. See below for example:
<PerformRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI" xmlns:ns2="urn:fault.partner.exacttarget.com">
<Action>ClearData</Action>
<Definitions>
<Definition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="DataExtension">
<CustomerKey>Test Data Extension</CustomerKey>
</Definition>
</Definitions>
</PerformRequestMsg>
This can also be done via WSProxy, like below:
<script runat="server">
custkey = 'myDE'
var prox = new Script.Util.WSProxy();
var action = "ClearData";
var props = {
DataExtension: {
CustomerKey: custkey
}
};
var opts = {};
var data = prox.performItem("DataExtension", props, action, opts);
</script>