EPM GROOVY – How to Create Custom Files in EPM Inbox from Calculation Manager

Due to job console output limits, one of the primary issues consultants experience is not being able to print the whole script which is sent back to Essbase execution. Some of us are already using alternative techniques to obtain the complete code, such as emailing the entire script to email using REST APIs, and uploading the text contents using REST APIs, to name a few. Finally, the I/O writer access creates files in the inbox/outbox explorer natively.

CREATE THE FILE

Here’s an example of how to do it. I’m trying to make a file with 1000 lines, which is extremely impossible to view all of in the job console.

Sample Hybrid Script:

Groovy
String calcScript = """
	FIX ("Budget","Working")
    	"FY21" (
            IF ("Actual" != #Missing)
                "Market Share" = Sales % Sales -> Market;
                "Product Share" = Sales % Sales -> Product;
                "Market %" = Sales % @PARENTVAL(Market, Sales);
                "Product %" = Sales % @PARENTVAL(Product, Sales);
            ENDIF                
        )        
	ENDFIX    
"""

Groovy Script to create the file in Inbox/outbox explorer:

Groovy
Writer writeToFile
try {
    writeToFile = createFileWriter("Script.txt")
    //trying to get 1000 lines
    100.times {
        writeToFile.write(calcScript)
    }
} catch (e) {
    println e.message
} finally {
    writeToFile.close()
}

OUTPUT FROM INBOX/OUTBOX