Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Working with Local Files and/or Identifying current day

Status
Not open for further replies.

adlloyd

IS-IT--Management
Jan 10, 2008
1
US
Greetings,

I'm using ProComm Plus to automate loading some files into a telnet system. I've got my dates/naming conventions and command transmission all set up, and my script works beautifully. What I encouter though is that on Monday's we have two files, one of which is named for the previous day, and one for two days prior to the current day. I understand how to get the date for the correct day (x * 86,400 where x is the number of days ago.) What I'm unsure of how to do with aspect is check the current day (i.e. Is Today Monday?), and run different procedures based on that, or to simply run a check before processing to say "Does a file with Saturday's date exist, if so run Process A then Process B, if not just run process B". I'm not sure if it would be easier with Aspect to identify the current day, or to identify whether a file exists, and in either case how to do it.

Has anybody encountered this or something similar? Any suggestions on how to go about this?

Many thanks,

Tony Lloyd
 
You can use the weekdaystr command to determine what day it is, will that do the trick? Below is a sample script from the ASPECT help file:

proc main
integer DayWeek ; Day of the week.
integer DayYear ; Day of the year.
integer LeapYear ; Leap year flag.
string Day ; Day of week as string.

ltimemisc $LTIME DayWeek DayYear LeapYear
weekdaystr DayWeek Day ; Get day of week in string form.
usermsg "It is %s!" Day ; Display day of week.
endproc

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top