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!

Capture: specified file created but captures to new default file

Status
Not open for further replies.

Phil121

Programmer
Aug 7, 2007
5
US
I have a complex (for me) script that connects to an ERA system and then spawns another script to run and capture a report.

When run as a whole, the capture ON creates the specified file but then creates a default file and captures to it instead.

When running just the spawned script, it works fine.

The main script only makes the connection and logs into the system.
 
If you could provide a snippet of the code that relates to how you set up the capture, someone could probably help you out.
 
Here is the capture code:

SET terminal columns 132
SET capturepath "C:\DataExtractions"
SET capture overwrite ON
SET capture query OFF
SET capture file "NewExport.txt"
clear
pause 2
CAPTURE ON
pause 2
 
I should have included this:
The capture creates a file in the "C:\DataExtractions" directory named "NewExport.txt" 0 KB containing no data
and one named "connec1.cap" 514 KB containing all the data.

The script continues just fine.
 
I tried your code as you posted it, and it works correctly for me.

Once I created a C:\DataExtractions folder, procomm only created the NewExport.txt file.

Let me ask you this, is all of the above code from the same script, or is it from the two (the main one, and this spawned script)?

I think setting the capture file name and turning capture on need to be in the same script to do what you want.

 
Thanks for looking at this!

They are in the same script.

The main script makes a modem connection and logs on to the ERA DMS (dealer management system) based on parameters gathered from a text file and parsed into an array and broken out into variables.

Then another set of parameters is gathered from another file and is also parsed into an array and broken out into variables. This set of variables determines which report script to run. The report script does the capture after defining the report in the report generator.

The report script captures perfectly every time when started separately as stated in the original post.

I am going to break down the connection/login part of the main script. This is a massive upgrade from previous scripting where it worked fine.

My upgrade was built from connection-to-report instead of from the report-backto-connection.

If you think of anything, I'd be happy to check it. But it seems I need to break it down. I will post any findings in case anyone cares.

Thanks again!
 
Is the connec1.cap capture file defined in the Connection Directory entry that is being dialed (click the Basic Options button and look at the bottom of the dialog)? Is the capture OFF command in the spawned script or back in the main script (wasn't clear if you were using the chain or execute command to launch the child script)?

 
The Capture Off is in the spawned script.

I rebuilt the main script with the same modifications and tested it as I went and it works fine now.

Just one of those things.

Thanks for you help, knob and kodr!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top