[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
What operating system will you be executing on?
[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
We're operating on AIX, SCO Openserver and HP-UX.
[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
We're operating on AIX, SCO Openserver and HP-UX.
[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
We're operating on AIX, SCO Openserver and HP-UX.
[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
That closes the Windows API suggestion :-)
I believe I have heard about this before, have you tried this question for tech support?
[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
I talked to Tech support on friday, they didn't have a solution to directly tell if the process was running in tbe background or not.
We did talk about the STATION-ID in the Accept from System info. When running in the background it returns "(none)" as the station ID, which I did test under AIX and SCO Openserver, but it's undocumented so I'm a little concerned about whether I can really rely on it or not.
Based upon time frames I think it's going to have to be what I use though. I appreciate any thoughts though.
Brad
[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
hi phayes,
may I know how do you execute it in background?
Do toy apply the & at the end of the command?
[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
hi phayes,
may I know how do you execute it in background?
Do toy apply the & at the end of the command?
[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
hi phayes,
may I know how do you execute it in background?
Do toy apply the & at the end of the command?
[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
We're executing a shell script from the user's crontab that sets up the environment and then executes runcbl with the program name.
We also have the ability for the user to execute the same process online, in which case we call the same shell script from our applicatoin using the C$SYSTEM call.
[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
A background process is a process without TTY.
This mean that if you can inquiry in some way the table of
process, you'll see that your process hasn't any tty assigned.
Since the wide variety of *nix you have to support, it can be much
difficult to solve this problem in a "elegant" way (e.g. calling some API function) instead of simply set up a environment variable in
the calling script, and then reading this variable from the program.
e.g.
suppose the script that sets up the environment for your program is SCRIPT.SH, then I'd create another script who's name is BACKGROUND.SH where I would set:
<<
BACKGROUND=yes; export BACKGROUND
. /path_to/SCRIPT.SH
<<
then the cron will call BACKGROUND.SH, while the program still call SCRIPT.SH
hope this help,
Luca
[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
I think I'm going to have to rely on the station-id value. Due to deployment issues redesiging our batch process by putting another script in front would be very difficult due to deployment issues. I appreciate the thoughts!
Brad
[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
I think I'm going to have to rely on the station-id value. Due to deployment issues redesiging our batch process by putting another script in front would be very difficult due to deployment issues. I appreciate the thoughts!
Brad
[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
I think I'm going to have to rely on the station-id value. Due to deployment issues redesiging our batch process by putting another script in front would be very difficult due to deployment issues. I appreciate the thoughts!
Brad
[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
..why don't you pass the "run mode" as a command line parameter ?
runcbl miprog.acu batch
then: accept run-mode from command-line
etc.
you can also use an environment variable in the script:
run_mode=batch
export run_mode
runcbl myprog.acu, then:
accept run-mode from environment "run_mode"
[Migrated content. Thread originally posted on 16 April 2004]
I have several programs that users run sequentially as a day end process. These same programs are run by some users as a scheduled background process using a keystroke file.
If there is an unexpected errror such as a file I-O error, our standard error handler displays the error to the user and prompts them to hit enter. If this happens during the background process it causes the keystrokes to be off and the process then doesn't complete properly.
Does anyone know of any way to tell if a program is running in the background?. I'm thinking if I knew that, when running in the background I could log the error a file and not prompt the user to press enter.
One note to consider, these are not executed using the -b option to the runtime due to a runtime error we ran into using that when a program does a DISPLAY WINDOW, it determining whether it's in the background can't depend on that.
Brad Hayes
I appreciate the input. Again good ideas but they would require changes to the environment external to the program which would be very undesirable for us as opposed to a cobol only change.
So far the station-id method seems to be working for me!