Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to use sustvariables on a script Epmautomate

3477516Apr 29 2019 — edited May 10 2019

Hello,

I'm using EPM Automate to upload information into Oracle PBCS and its working fine, the only "problem" is that when I run a datarule I'm hardcoding the dates of the periods and I would like to use sustvariables instead but I'm unable to achieve it

This is the code I'm using:

@echo off

echo %time%

echo 

SETLOCAL ENABLEDELAYEDEXPANSION

SET EPM_AUTOMATE_DIRECTORY=xxxxxxxxxxxxxxx

SET URL_PBCS=xxxxxxxxxx

SET DOMAIN=xxxxxxxxxx

SET PASSWORD= xxxxxxxxxx

SET USER= xxxxxxxx

CALL epmautomate login  %USER% %PASSWORD% %URL_PBCS% %DOMAIN%

call epmautomate getsubstvar ALL name=Year

call epmautomate getsubstvar ALL name=Month

--- Until this point I dont have an issue  with login and showing the substitution variables

--- The following is the part not working for me, I'm trying to get the values of the sustitution variables and use them as parameters on the datarule

SET count=1

FOR /F "tokens=* USEBACKQ" %%F IN (`  "call epmautomate getsubstvar ALL name =Year"    `) DO (

SET var!count!=%%F

SET /a count=!count!+1

)

ECHO %var2%

SET Year=%var2:~13,2%

SET count=1

FOR /F "tokens=* USEBACKQ" %%F IN (`  "call epmautomate getsubstvar ALL name =Month"    `) DO (

SET var!count!=%%F

SET /a count=!count!+1

ECHO %var2%

SET Month=%var2:~12,2%

ECHO %Month%-%Year%

When I add the part above of the code the cmd just closes when I execute it

Comments