Jump to content

Recommended Posts

Posted

I dont see any problem.

The only issue that I can see is that each time that the profile will be invoked, then the TABLE file will be executed with chances that the global variable will change, which this, can become an issue depending how and where this variable is used

Posted

The code gets executed with every request whether the user needs &&DATA_AS_OF_DATE or not. Try to minimize the overhead of setting the global variable.

 

 

If it meets your requirements, you could use global variables value from a previous request in the same session. Check for its value to avoid HOLD and -READFILE.

-IF &&GGDATE.EXISTS THEN NOTF;

 

TABLE FILE GGSALES

SUM MAX.DATE AS 'GGDATE'

ON TABLE SET ASNAMES ON

ON TABLE HOLD AS GGDATE

END

-RUN

-DEFAULTH &GGDATE = ' ';

-READFILE GGDATE

-TYPE READFILE executed.

-SET &&GGDATE = &GGDATE;

 

-NOTF

-TYPE &|&|GGDATE = &&GGDATE

 

 

If &&DATA_AS_OF_DATE has the same value for everyone throughout the day, you could create the hold file once per day with ReportCaster. Then just do the -READFILE of the already existing HOLD file.

Posted

Has anyone used a TABLE request to set a global variable in the edasprof.prf

Im thinking about doing something like this, but wondered what pitfalls I might encounter

SET HOLDLIST = PRINTONLY

SET ASNAMES = ON

TABLE FILE ETL_PROCESS_LOG

SUM MAX.DATA_DATE AS DATA_AS_OF_DATE

WHERE PROCESS_NAME EQ schedule_DAILY_LOAD

WHERE PROCESS_EVENT_NAME EQ End

ON TABLE HOLD AS HOLD_MAX_DATE

END

-RUN

-READFILE HOLD_MAX_DATE

-DEFAULTH &DATA_AS_OF_DATE=;

-SET &&DATA_DATE = EDIT(&DATA_AS_OF_DATE, 99/99/9999);

Thanks in advance for sharing your knowledge and experience!

Deb

Posted

Another option would be to use "Paths to be executed on user Sign-in (IBI_SIGNIN_PATHS)"set in the admin console.

It get executed on login and can point to a fex in the repository or on the server. So only one execution.

Posted

I was not able to get the Paths to be executed option to work. I also realized that the date can change during the day, so I thought it best to just add my original code to the edasprof.prf and that seems to be working as we need it to.

Thanks everyone!

Posted

Hey guys, I have a similar requirement to conditionally enable OPSYSCMD in a user profile.

I tried to have a Launch fex to SET this &&DEPLOY value but that did not work or take effect in the profile. Logically it should have enabled DOS commands and enabled OPSYSCMD but it gives me the standard SYS COMMANDS DISABLED error

-*This is the launch fex

-SET &&DEPLOY=Y

EX mainfex.fex

-* This is my mainfex

DOS DIR

-* This is the user profile

SET OPSYSCMD=OFF

-IF &&DEPLOY EQ N THEN GOTO SKIP_DOS;

SET OPSYSCMD = ON

-SKIP_DOS

Posted

Im changing it a bit, in user profile but still not quite there. Not sure why its giving me such a hard time to conditionally. What am I missing

Please share your thoughts!

-DEFAULTH &&OPSYALLOW =N ;

-SET &P = IF &&OPSYALLOW EQ Y THEN ON ELSE OFF ;`

SET OPSYSCMD = &P

Posted

Thanks David, I tried with local variable as well no luck. I dont understand your commend about backward quote, seems fine to me.

-DEFAULT &OPSYALLOW =N;

-SET &P = IF &OPSYALLOW EQ Y THEN ON ELSE OFF ;

SET OPSYSCMD = &P

Posted

pawan.vuppala:

 

I dont understand your commend about backward quote, seems fine to me.

 

 

See the character at the end of the line:

 

image.png1051251 27.6 KB

 

If that was actually in your code, it would cause a problem.

The most recent code you posted doesnt have that extra character so maybe it is not an issue. Your code looks like it would work, however be aware, I dont think you need the case for:

SET OPSYSCMD = ON

 

because if it is already ON then you can just leave it ON. If it is already OFF, then you cant turn it back on.

So you can simply code it as:

-DEFAULT &OPSYALLOW = 'N';

 

-IF &OPSYALLOW EQ 'Y' THEN GOTO EndSET;

 

SET OPSYSCMD = OFF

 

-EndSET

 

SET OPSYSCMD

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...