Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Dynamically setting a variable
Topic Summary:
Created On: 03/08/2010 12:36 PM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by SteveNorwood, on Tuesday, July 6, 2010 1:30 PM

Answer:
Jean,

How would this be accomplished in BPA server with shared variables?

Thanks,

Steve
 03/08/2010 12:36 PM
User is offline View Users Profile Print this message

Author Icon
SteveNorwood
Journeyman (50-99)

Posts: 90
Joined: 11/28/2005

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


 Category Survey
 03/08/2010 12:51 PM
User is offline View Users Profile Print this message

Author Icon
JeanDelfosse
Supreme Guru (1000+)

Posts: 8883
Joined: 03/30/2005

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

 Category Survey


-------------------------
Jean Delfosse - Automate Beta Tester
Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4
 03/08/2010 06:25 PM
User is offline View Users Profile Print this message

Author Icon
SteveNorwood
Journeyman (50-99)

Posts: 90
Joined: 11/28/2005

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

 Category Survey
 03/09/2010 11:14 AM
User is offline View Users Profile Print this message

Author Icon
JeanDelfosse
Supreme Guru (1000+)

Posts: 8883
Joined: 03/30/2005

Like this ?



 Category Survey



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
 07/02/2010 08:53 AM
User is offline View Users Profile Print this message

Author Icon
SteveNorwood
Journeyman (50-99)

Posts: 90
Joined: 11/28/2005

Answer Answer
Jean,

How would this be accomplished in BPA server with shared variables?

Thanks,

Steve

 Category Survey
 07/02/2010 01:46 PM
User is offline View Users Profile Print this message

Author Icon
JeanDelfosse
Supreme Guru (1000+)

Posts: 8883
Joined: 03/30/2005

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

 Category Survey


-------------------------
Jean Delfosse - Automate Beta Tester
Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4
 01/21/2013 02:00 PM
User is offline View Users Profile Print this message

Author Icon
BrianPearson
Expert (100-199)

Posts: 149
Joined: 04/08/2005

Jean, where is the "treat as parameter" option? in Set Variable, I just see "Disguise initial value"


 Category Survey
 01/21/2013 08:56 PM
User is offline View Users Profile Print this message

Author Icon
JeanDelfosse
Supreme Guru (1000+)

Posts: 8883
Joined: 03/30/2005

Brian,
it is not in the SET VARIABLE but in the CREATE VARIABLE step "advanced" tab

 Category Survey


-------------------------
Jean Delfosse - Automate Beta Tester
Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 1157 guests browsing this forum, which makes a total of 1157 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog