(a) In Working with the SUBMIT Command, about half way down, there is a screen shot of the Submit tab of the SPFLite Global Options. The prototype contains the program being executed, SPFSUBMIT·EXE, with its execution path, which in the example is "C:\Program files (x86)\SPFLite\". Clearly, the prototype in the example has a path.
+++++++++++++++++++++++++++++++++
And it is in the middle of the discussion re SPFSUBMIT.EXE which is for submitting to Hercules. I am not using Hercules so please get Hercules out of your mind for this discussion. The documentation for the SUBMIT command states as the first line of the description "The SPFLite SUBMIT primary command allows a program or batch file to be launched from SPFLite." Nowhere in the entire article does it mention Hercules. It specifically states that it can be used to submit batch files which generally means those files ending .BAT. And this is what I am attempting to do.
+++++++++++++++++++++++++++++++++
--
(b) In the text of this help article we find this: "The SPFSUBMIT·EXE program is provided with SPFLite to facilitate the submission of jobs for SPFLite to Hercules. The SPFLite installation will ensure this program is available to execute without requiring a full path, or you may specify a full path for this program if it is located elsewhere."
+++++++++++++++++++++++++++++++++
Irrelevant - I am not submitting to Hercules and that is what SPFSUBMIT.EXE is for - according to "working with the SUBMIT Command"
+++++++++++++++++++++++++++++++++
--
(c) The PATH information required to run the supplied SPFSUBMIT·EXE is the same PATH information required to run SPFLite itself. If SPFLite is running, and you run SPFSUBMIT·EXE, you should not require an explicit path on your prototype. (If that is not the case, then our documentation would be in error and we would have to correct it.) Have you run into a situation where you tried to run SPFSUBMIT·EXE and it didn't work? You don't mention Hercules, so I am assuming you are not using SUBMIT for that purpose.
+++++++++++++++++++++++++++++++++
Irrelevant - I am not submitting to Hercules and that is what SPFSUBMIT.EXE is for - according to "working with the SUBMIT Command"
+++++++++++++++++++++++++++++++++
--
(d) Strictly speaking, in Windows, a path is always required. However, what you probably mean is an explicit path that is other than the one in which the SPFLite executable is running under. You asked, "If one is not required where is the ·BAT to be placed?" The short answer is, where do you want it to be placed? If you want it in some specific place, you would put an explicit path to the BAT file in the prototype. If you don't want to do that, you can use the default submit directory for it.
+++++++++++++++++++++++++++++++++
If the screen shot of the OPTIONS dialogue was at the top of the article and a brief description of the fields followed the description culd be along the lines of:
Full path and filename of the batch file to be executed along with SPFLite SUBMIT codes as parameters.
(Actually I think that the SUBMIT codes
could be in a separate box.)
+++++++++++++++++++++++++++++++++
--
(e) In researching this, you are correct that the documentation doesn't jump up and down and point this out, but in the Working With article, if you look at the Submit options screen, there is a field named Working Directory to be used by SUBMIT. That is the answer to your question. If you don't want to put an explicit path on your submit prototype, the BAT file or other files (like EXE) would go in the submit working directory. Of course, these are both defined on the same Submit options screen, so you're not saving much by omitting it from the prototype line. Even so, the working directory is where the temp files are written to, so you really need to define this. In my case, I made a directory called C:\SPFSUB, and I have a couple of demo BAT files there that I use when I want to test the SUBMIT command. I would have to agree that this aspect needs to be documented better.
You can see how this works if you do the following: Set up the Submit prototype line so it's a non-existent batch file, like JUNK·BAT. Now, go to any edit screen and type SUBMIT DEBUG. The submit process will run, and will leave the Windows command-line screen up. Now, look at the path shown in the command prompt. You will see that it is the same as the Submit working directory, because that's where the CMD·EXE for your BAT file is running from. By the way, if you do a DIR at this point, you will see all the temp files SUBMIT has created. You can delete them if you wish.
*****
2. "What was my ·BAT doing? Simply invoking my C compiler (TCC) which requires one parameter - the file of C code to be compiled. This must have a file type of '.c'. The only line in this ·BAT file is: TCC %1 >%2. My prototype is: path\tcc_comp·BAT ~i ~r
--
(a) As documented in the SUBMIT help, the ~i submit code is the full path name of the temporary file created by submit, which is described as having a file name format of SUBMIT_JOB12345.TXT. So, when you pass this to TCC, that's the file name it gets. So far, SUBMIT is doing what we said it would.
--
(b) The problem for you is that TCC doesn't want a file with an extension of .TXT to compile. I am not familiar with TCC, but in the Microsoft C compiler, there are command-line options to force the input file to be treated as C or C++ regardless of the file's extension. Perhaps TCC has a similar feature.
--
You have other alternatives. If you look at the SUBMIT help article, there are additional SUBMIT codes that could help. These are:
~F = the simple file name of the original file without the path or extension
~N = the full, complete name of the original file, path included
~P = the path of the directory containing the original file
~X = the file extension of the original file, including the leading dot
You could use this information in your BAT file to rename the temporary file whose name is in the ~I submit code to any name you wanted, including one with a .C extension. If you did that, you would need to rename the file back when you are done, otherwise SPFLite's temp-file cleanup logic would not see it and it would not get cleared from the Submit working directory.
+++++++++++++++++++++++++++++++++
Yes - I will probably have to set about renaming the TXT file. I was trying to avoid that.
Please note that ~x does NOT return the leading dot.
+++++++++++++++++++++++++++++++++
*****
3. "Path: Win 8.1 does not require paths that include spaces to have quotes around them."
--
I am not sure in what context you are referring to, but in BAT files and the conventional Windows command line, you do indeed need to put such files in quotes. The only time you can omit that is if you are entering a file name into a field of a GUI window of some kind.
+++++++++++++++++++++++++++++++++
I admit to only testing with a CD command but it took that without a quibble.
+++++++++++++++++++++++++++++++++
*****
4. "BROWSE for File" button: this would bring up a file tree window, as you get when you do a SAVEAS, from which you click on the file required and the box is populated with the full path and filename."
--
I am afraid I still don't understand. Are you saying you want this ability within a edit session? The purpose of SUBMIT is to mimic the SUBMIT command in IBM ISPF, which is intended to submit the file you are currently editing. Are you asking to use SUBMIT while editing a certain file, but you actually want to submit some OTHER file, and you want to browse a file list to decide which one you want? I am not sure I understand why you'd want to do that. In any case, you already have the ability to submit jobs from the File Manager, by using the J or SUBMIT (SUB) line command. Did you want something in addition to this?
+++++++++++++++++++++++++++++++++
No, I believe I stated it with regard to populating the protorype box.
+++++++++++++++++++++++++++++++++
*****
5. "Hercules: The manual page for SUBMIT does not mention Hercules at all. It specifically starts the Description with: "The SPFLite SUBMIT primary command allows a program or batch file to be launched from SPFLite". Hercules is not mentioned until the third paragraph of "Working with SUBMIT".
--
I can't argue that SUBMIT is written as you describe. However, SUBMIT is a general purpose facility, which supports Hercules, but is not tied to is. Some users may have completely different requirements, such as running an external FTP program to transmit a file to a remote system, for instance. We are not insisting that people use SUBMIT only for Hercules. But, bear in mind that this was its primary purpose, especially for users that run things like DOS/VS and MVS/SP but don't have an ISPF component; they can run SPFLite and SUBMIT jobs to their emulated mainframes, and it works well when they do this.
+++++++++++++++++++++++++++++++++
Irrelevant - I am not submitting to Hercules and that is what SPFSUBMIT.EXE is for - according to "working with the SUBMIT Command"
+++++++++++++++++++++++++++++++++
*****
6. "SUBARG: I am not sure about this but I think it does not resolve any of the problems. IT still needs a SUBMIT to work."
--
(a) I am puzzled by this. The SUBARG is a means to define a SUBMIT argument that is specific to a file type, since each file type's PROFILE has its own SUBARG. One of the things you asked about is submitting compiles in different languages. Let's say you used C, C++ and Rexx. You could set the SUBARG in each different profile to some value, and then in your BAT file that does the actual execution, you would have IF statements that tested "~Z" or "^Z" and then conditionally run various compilers, or the same compiler with different command line options. Isn't that a problem you needed to resolve? Why do you say this doesn't resolve anything?
+++++++++++++++++++++++++++++++++
I like to compartmentalise. On the mainframe I have separate jobs for compiling cobol, PL/I and assembling assembler programs. I want separate batch files for windows too so that a change for one does not muck up another. Given that, I do not see the need, for me, to set anything using SUBARG - at the moment.
+++++++++++++++++++++++++++++++++
--
(b) SUBARG is an argument to SUBMIT. It creates a Submit code of ~Z or Z^. Of course it needs SUBMIT to work. Were you expecting something different?
*****
7. "SUBCMD: fine - a way to alias SUBMIT to another command - in my case I have aliased it to RUN for my rexx stuff."
--
(a) The primary purpose of SUBCMD is to avoid SUBMIT errors. Here is the scenario: A user has a Hercules system, and has a bunch of JCL files they submit, so they get in the habit of saying SUBMIT or SUB all the time. Then, they have other files like BAT or REXX that they want to run from the edit session, and out of habit, they say SUBMIT again - only, these are not submittable files, and it causes a problem. By defining SUBCMD as RUN for BAT and REXX files, for instance, it means that as you're working, you don't have to keep "switching hats" and remembering to issue the right command - SUBMIT or RUN. You can just say SUBMIT or SUB all the time, and the SUBARG will make sure you do the right thing for the right file type.
--
(b) SUBARG does not "resolve" any submit issues. All it is intended for is to AVOID actually submitting a file when you didn't really want to do that.
*****
8. "Today I ran a different batch file which simply ECHOed each parameter. First, the command line was too long - no problem just restrict the number of parameters (to 5 in this case) and try again. The commands within the batch file weere simply:
ECHO %1
ECHO %2
ECHO %3
ECHO %4
ECHO %5
and the prototype:
"C:\users\nicc\documents\spflite\run\testsub·BAT" ~i ~R ~c ~d ~e
Apart from forgetting to close my quotes on the prototype (which may have lead to the excessive command length) ~e gave a "wrong" result. ~e translates to: "C:\Program Files\...." but the ECHO only shows "C:\Program". Possibly the problem there lies with Windows?
#edit# just noticed in the docco that I may need to enclose ~e in quotes. Still to do that fix and try so please ignore."
--
(a) As noted above, as far as I know, any file specified on a BAT file that has embedded spaces must be quoted. Even if a command line itself could handle embedded blanks (and I don't believe it could) the batch file is read by a separate process which then hands command lines to Windows for execution, so in a BAT file, it's a two-step process. Command line values with embedded blanks would never 'survive' that two-step process without being quoted.
--
(b) If you are still having problems after properly quoting your file names, you should give us a copy of your BAT file and we can try to replicate the issue.
+++++++++++++++++++++++++++++++++
Nope - getting the quotes right resolved it. It was successful execution of that batch file that let me know that ~x does not have the leading dot.
+++++++++++++++++++++++++++++++++
*****
9. "Macro: I have not yet looked at the possibility of using a macro but...I would prefer to do my compiles in the background which may not be possible as I believe SPFLite suspends execution until the submitted task ends. But I am not sure about that - there was a discussion in the bugs section a few days ago which I will have to review."
--
(a) Doing a background compile is more than feasible, but it's not SPFLite's fault if it doesn't run in the background. The only way you can make a thing like that happen is to put a START command in your BAT file. That will launch your process and then "let go" so SPFLite can resume what it was doing.
(b) I would have to say again, I suspect that SUBMIT is not even what you should be using anyway. You are running batch files. That is what RUN is intended for, unless I am misunderstanding something.
+++++++++++++++++++++++++++++++++
And that is what the SUBMIT command is for - according to the command description.
+++++++++++++++++++++++++++++++++
(c) It seems like neither of us completely understands the other side here. We need to continue this dialog to get to the bottom of it.
(d) Finally, I hope you will keep notes on your learning experience. You say that we don't have good examples, well fair enough. Maybe YOU can contribute some examples, as you learn from this experience. The fact is, very few SPFLite users have even tried to SUBMIT, and most of them use it for Hercules, and the Help doc already covers that case pretty well. Try to write up what you are doing and how you solved your problems. We might be able to incorporate your story in the next version of the Help when it comes out.
+++++++++++++++++++++++++++++++++
Will do
+++++++++++++++++++++++++++++++++