![]() |
|
![]() |
AutoMate Discussion | ![]() |
Topic Title: Dynamically setting a variable Topic Summary: Created On: 03/08/2010 12:36 PM Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Jean, How would this be accomplished in BPA server with shared variables? Thanks, Steve | ||||
![]() |
||||
Is there a way to determine the day and then set a variable accordingly? I'm sure there is but need some guidance. I have no problem determining the day.
We get nightly files into our location. Tuesday through Thursday the files are processed nightly but the files we get on Friday night are not processed until Monday morning for certain reasons. I usually set the variable to be Date - 1 for Tuesday through Thursday and Date - 3 for Friday files that are run on Monday. I have done this in the past by creating separate workflows with the specific variables in each one but then you have task sprawl and I want to avoid that. Thanks, Steve
|
||||
|
||||
![]() |
||||
Steve,
I think the extended function WeekDay(dateexpr) is what you need. You can see its specs in the help at Technical reference / Basic Scripting / Functions / Weekday Function
------------------------- Jean Delfosse - Automate Beta Tester Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4 ![]() |
||||
|
||||
![]() |
||||
Jean,
Thanks for the response. What I am looking for is if I determine the day is WeekDay = 2 I want to set a variable called %varDate% to %FORMAT(NOW)-3,'YYYYMMDD')%. If the WeekDay is anything else, I want %varDate% to equal %FORMAT(NOW()-1'YYYYMMDD')% Make sense? Thanks for the help. Steve
|
||||
|
||||
![]() |
||||
Like this ?
Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder) ------------------------- Jean Delfosse - Automate Beta Tester Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4 ![]() Edited: 03/09/2010 at 11:52 AM by JeanDelfosse |
||||
|
||||
![]() |
||||
Jean,
How would this be accomplished in BPA server with shared variables? Thanks, Steve
|
||||
|
||||
![]() |
||||
Streve,
it should be done in the first task of the workflow. Then the AMVARIABLE step should be set with the "Treat as parameter" option
------------------------- Jean Delfosse - Automate Beta Tester Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4 ![]() |
||||
|
||||
![]() |
||||
Jean, where is the "treat as parameter" option? in Set Variable, I just see "Disguise initial value"
|
||||
|
||||
![]() |
||||
Brian,
it is not in the SET VARIABLE but in the CREATE VARIABLE step "advanced" tab
------------------------- Jean Delfosse - Automate Beta Tester Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4 ![]() |
||||
|
FuseTalk Enterprise Edition v4.0 - © 1999-2021 FuseTalk Inc. All rights reserved.