| Welcome to LawsonTalk. We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. After registration, please check your e-mail within 24 hours for an message from us, read it, and reply to it. Join our community! If you're already a member please log in to your account to access all of our features: |
| Call "SYSTEM" from custom COBOL program | |
|---|---|
| Topic Started: Apr 24 2009, 11:52 AM (231 Views) | |
| JohnC | Apr 24 2009, 11:52 AM Post #1 |
|
Member
![]() ![]() ![]() ![]()
|
I've written a custom COBOL batch program (named P1006) that I want to use to call a SQL-Server package from the operating system command line. The command string I'm generating within the P1006 uses two parameters entered into the program by the user. The COBOL program compiles correctly and executes. However, the command string being executed is not the command string that the program is generating. I put in a display so that it echoes the command to an output file and I've verified the command syntax is correct. I've gone as far as copying the command to my Windows clipboard, pasting it into a DOS prompt, and executing it without error. The problem is that when the command is actually executed by COBOL, it's putting my two parameters plus a "N" character in front of the command string. The command string then fails. Below is the output file from my P1006 program. You'll be able to see the command string I'm trying to execute (following the "USING COMMAND STRING OF" entry) and the actual command that is executed (beginning with the word "Option"). -------------------------------------------------------------------------------- User: PRO1S\lawson Job: TEST Queue: ********** -------------------------------------------------------------------------------- BEGIN: Job Submitted: Fri Apr 24 11:33:03 2009 Step 1: P1006 Started. . . . . .: Fri Apr 24 11:33:03 2009 Token Command. . . . . .: F:\LAWPROD\law\prod1\obj\P1006.gnt Executable Command . . .: C:\NetExpress5\Base\Bin\run.exe F:\LAWPROD\law\prod1\obj\P1006.gnt prod1 NT00001509 TEST 1 Process ID . . . . . . .: 8212 Running as Account . . .: PRO1S\lawson Program Messages: ** Creating .prt and .dtl files Error Not Found (P1006.051) USING COMMAND STRING OF: dtexec /FILE "\\wchlawapp01\f$\DTSX_packages\Test_SSIS_package.dtsx" /SET "\Package.Variables[User::MONTH_END_DATE].Properties[Value ]";20090131 /SET "\Package.Variables[User::COMPANY].Properties[Value]";11 Microsoft (R) SQL Server Execute Package Utility Version 9.00.3042.00 for 32-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Option "1120090131Ndtexec /FILE \\wchlawapp01\f$\DTSX_packages\Test_SSIS_package.dtsx /SET \Package.Variables[User::MONTH_END_DATE].Properties[Value];20090131 /SET \Package.Variables[User::COMPANY].Properties[Value];11 F:\LAWPROD\law/print/PRO1S_lawson/test/1/P1006.prt" is not valid. Elapsed Time . . . . . .: 00:00:00 P1006 Completed. . . . .: Fri Apr 24 11:33:03 2009 Step 1: Completed. . . . .: Fri Apr 24 11:33:03 2009 Elapsed Time: 00:00:00 END: Job Ended: Fri Apr 24 11:33:03 2009 |
![]() |
|
| JohnC | Apr 24 2009, 12:57 PM Post #2 |
|
Member
![]() ![]() ![]() ![]()
|
With help from another forum, I was able to resolve the error. Thanks folks. |
![]() |
|
| « Previous Topic · Coding, Program Errors and Bugs · Next Topic » |





![]](http://209.85.48.22/static/1/pip_r.png)



10:30 PM Jul 31