SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Date/File log grabs

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Date/File log grabs
Author Message
Tom Smit



Joined: 26 Jan 2000
Posts: 21

Post Date/File log grabs Reply with quote

Assuming that all variables are defined. Basically what I'm trying to do is run a batch file with two command line arguments. However, this isn't quite working. Any ideas? I could possibly be using the file_name object wrong, i extended on one of the provided scripts, but i'm not sure quite where to go from here.

// Get todays's date
Today( today )
// Calculate yesterday's date
DateAdd( today, -1, yesterday )
// Convert to string in mmddyyyy format
Concat( file_name, "ex", file_name)
Concat( yesterday, "yymmdd", file_name )
//Append file extension
Concat( file_name, ".dat", file_name )

Concat( "c:\bin\make.bat ", @DP"yyyymm", command )
RunAndWait( command, "c:\bin",0, process_id )
RunAndWait( "c:\bin\logpull.exe", "c:\bin", 0, process_id)
Concat ("c:\bin\doit.bat ",@DP"yyyymm", command2 )
Concat (command2, file_name, command2)
Run (command2, "c:\bin", process_id)

Wed Jan 26, 2000 5:05 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7907

Post Re: Date/File log grabs Reply with quote

What did you want to do in line > ?

It looks like you are trying to something like the following:
Concat( "c:\bin\make.bat ", @DP"yyyymm", command )

Concat ("ex", @DP"mmddyyyy", command2 )
Concat ("c:\bin\doit.bat ", command2, command2)
Concat (command2, ".dat", command2)

RunAndWait( command, "c:\bin", 0, process_id )
RunAndWait( "c:\bin\logpull.exe", "c:\bin", 0, process_id)
Run (command2, "c:\bin", process_id)

: Assuming that all variables are defined. Basically what I'm trying to do is
: run a batch file with two command line arguments. However, this isn't
: quite working. Any ideas? I could possibly be using the file_name object
: wrong, i extended on one of the provided scripts, but i'm not sure quite
: where to go from here.

: // Get todays's date
: Today( today )
: // Calculate yesterday's date
: DateAdd( today, -1, yesterday )
: // Convert to string in mmddyyyy format
: Concat( file_name, "ex", file_name)
: Concat( yesterday, "yymmdd", file_name )
: //Append file extension
: Concat( file_name, ".dat", file_name )

: Concat( "c:\bin\make.bat ", @DP"yyyymm", command )
: RunAndWait( command, "c:\bin",0, process_id )
: RunAndWait( "c:\bin\logpull.exe", "c:\bin", 0,
: process_id)
: Concat ("c:\bin\doit.bat ",@DP"yyyymm", command2 )
: Concat (command2, file_name, command2)
: Run (command2, "c:\bin", process_id)

Wed Jan 26, 2000 6:47 pm View user's profile Send private message
Tom Smit



Joined: 26 Jan 2000
Posts: 21

Post Re: Date/File log grabs Reply with quote

This might help a little more, i found something:
Basically, i'm looking to create a file_name object with the exyymmdd.dat
type of file, then pass it as the second argument to a batch file (doit.bat)

---cut----
// Get todays's date
Today( today )
// Calculate yesterday's date
DateAdd( today, -1, yesterday )
// Convert to string in mmddyyyy format
Format( yesterday, "yymmdd", file_name)
//Append file extension
Concat( "ex", file_name, file)
Concat( file, ".dat", file)

Concat( "c:\bin\make.bat ", @DP"yyyymm", command )
RunAndWait( command, "c:\bin",0, process_id )
//RunAndWait( "c:\bin\logpull.exe", "c:\bin", 0, process_id)
Concat ("c:\bin\doit.bat ",file, command2 )
//Concat (command2, file , command2)
Run (command, "c:\bin", process_id)

---cut-----

: What did you want to do in line > ?

: It looks like you are trying to something like the following: Concat(
: "c:\bin\make.bat ", @DP"yyyymm", command )

: Concat ("ex", @DP"mmddyyyy", command2 )
: Concat ("c:\bin\doit.bat ", command2, command2)
: Concat (command2, ".dat", command2)

: RunAndWait( command, "c:\bin", 0, process_id )
: RunAndWait( "c:\bin\logpull.exe", "c:\bin", 0,
: process_id)
: Run (command2, "c:\bin", process_id)

Wed Jan 26, 2000 6:57 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7907

Post Re: Date/File log grabs Reply with quote

Concat( "ex", @DP"yymmdd", file_name )
Concat( file_name, ".dat", file_name )

: This might help a little more, i found something: Basically, i'm looking to
: create a file_name object with the exyymmdd.dat
: type of file, then pass it as the second argument to a batch file (doit.bat)

: ---cut----
: // Get todays's date
: Today( today )
: // Calculate yesterday's date
: DateAdd( today, -1, yesterday )
: // Convert to string in mmddyyyy format
: Format( yesterday, "yymmdd", file_name)
: //Append file extension
: Concat( "ex", file_name, file)
: Concat( file, ".dat", file)

: Concat( "c:\bin\make.bat ", @DP"yyyymm", command )
: RunAndWait( command, "c:\bin",0, process_id )
: //RunAndWait( "c:\bin\logpull.exe", "c:\bin", 0,
: process_id)
: Concat ("c:\bin\doit.bat ",file, command2 )
: //Concat (command2, file , command2)
: Run (command, "c:\bin", process_id)

: ---cut-----

Wed Jan 26, 2000 7:08 pm View user's profile Send private message
Tom Smit



Joined: 26 Jan 2000
Posts: 21

Post Re: Date/File log grabs Reply with quote

I figured that part out, the problem i'm having is passing two arguments to the batch file.

: Concat( "ex", @DP"yymmdd", file_name )
: Concat( file_name, ".dat", file_name )

Wed Jan 26, 2000 7:10 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7907

Post Re: Date/File log grabs Reply with quote

So you want to concatenate 3 pieces into one piece?

Concat( a, b, temp )
Concat( temp, c, result )

or even simplier (assuming that result = a in the beginning)

Concat( result, b, result )
Concat( result, c, result )

: I figured that part out, the problem i'm having is passing two arguments to
: the batch file.

Thu Jan 27, 2000 11:27 am View user's profile Send private message
Tom Smit



Joined: 26 Jan 2000
Posts: 21

Post Re: Date/File log grabs Reply with quote

This is what i have:

---cut---
Concat ("c:\bin\doit.bat ",@DP"yymmdd", command2 )
Concat (command2, file_name , command2)
Run (command2, "c:\bin", process_id)
---cut---

doit.bat is a batch file that wants to cd into \%1 (which should be the date) and then do something, and then copy file %2 (file_name). However, it's not even doing the cd right. It's staying right in the bin directory.

: So you want to concatenate 3 pieces into one piece?

: Concat( a, b, temp )
: Concat( temp, c, result )

: or even simplier (assuming that result = a in the beginning)

: Concat( result, b, result )
: Concat( result, c, result )

Thu Jan 27, 2000 11:45 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7907

Post Re: Date/File log grabs Reply with quote

Have you looked at the trace file? If not please turn on tracing in the Preferences. This will tell you where the script/or batch do not work as expected.

: This is what i have: ---cut---
: Concat ("c:\bin\doit.bat ",@DP"yymmdd", command2 )
: Concat (command2, file_name , command2)
: Run (command2, "c:\bin", process_id)
: ---cut---

: doit.bat is a batch file that wants to cd into \%1 (which should be the date)
: and then do something, and then copy file %2 (file_name). However, it's
: not even doing the cd right. It's staying right in the bin directory.

Thu Jan 27, 2000 11:59 am View user's profile Send private message
Tom Smit



Joined: 26 Jan 2000
Posts: 21

Post Re: Date/File log grabs Reply with quote

I see now where the problem is, it's what i thought. It's not putting a space between the two arguments. Instead of running doit.bat 200001 ex000125.dat it's running "doit.bat 200001ex000125.dat"

: Have you looked at the trace file? If not please turn on tracing in the
: Preferences. This will tell you where the script/or batch do not work as
: expected.

Thu Jan 27, 2000 12:04 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.