Skip to main content

[archive] batch accept

  • September 12, 2008
  • 10 replies
  • 0 views

[Migrated content. Thread originally posted on 12 September 2008]

I'd like to have a bat file that runs a simple batch program but the program accepts parameters at run time from the bat file. Please forgive me but in what I'm used to, some JCL could be written with the following:

run prog1
Y
N
end job

PROG1 starts, it sends a display/accept for parm 1 and gets back a 'Y' and then sends a display/accept for parm 2 and gets back an 'N'.

If the bat file contains the following, how do you get PROG1 to accept the run parameters. Adding the 2 parms under the bat file statement won't work. Can the run statement include something like "accept Y,N at start"

C:\\acucobol\\object\\PROG1.acu

10 replies

[Migrated content. Thread originally posted on 12 September 2008]

I'd like to have a bat file that runs a simple batch program but the program accepts parameters at run time from the bat file. Please forgive me but in what I'm used to, some JCL could be written with the following:

run prog1
Y
N
end job

PROG1 starts, it sends a display/accept for parm 1 and gets back a 'Y' and then sends a display/accept for parm 2 and gets back an 'N'.

If the bat file contains the following, how do you get PROG1 to accept the run parameters. Adding the 2 parms under the bat file statement won't work. Can the run statement include something like "accept Y,N at start"

C:\\acucobol\\object\\PROG1.acu
Display statements are really not a good idea for true batch jobs. With Extend a display statement tries to create a window on the terminal / console and in the case of a batch job you do not want this to occur.

Have the program accept values from environment variables and then set the environment variables in your batch script.

[Migrated content. Thread originally posted on 12 September 2008]

I'd like to have a bat file that runs a simple batch program but the program accepts parameters at run time from the bat file. Please forgive me but in what I'm used to, some JCL could be written with the following:

run prog1
Y
N
end job

PROG1 starts, it sends a display/accept for parm 1 and gets back a 'Y' and then sends a display/accept for parm 2 and gets back an 'N'.

If the bat file contains the following, how do you get PROG1 to accept the run parameters. Adding the 2 parms under the bat file statement won't work. Can the run statement include something like "accept Y,N at start"

C:\\acucobol\\object\\PROG1.acu
I'm new to this arena, can you provide an example?

[Migrated content. Thread originally posted on 12 September 2008]

I'd like to have a bat file that runs a simple batch program but the program accepts parameters at run time from the bat file. Please forgive me but in what I'm used to, some JCL could be written with the following:

run prog1
Y
N
end job

PROG1 starts, it sends a display/accept for parm 1 and gets back a 'Y' and then sends a display/accept for parm 2 and gets back an 'N'.

If the bat file contains the following, how do you get PROG1 to accept the run parameters. Adding the 2 parms under the bat file statement won't work. Can the run statement include something like "accept Y,N at start"

C:\\acucobol\\object\\PROG1.acu
I'm new to this arena, can you provide an example?

[Migrated content. Thread originally posted on 12 September 2008]

I'd like to have a bat file that runs a simple batch program but the program accepts parameters at run time from the bat file. Please forgive me but in what I'm used to, some JCL could be written with the following:

run prog1
Y
N
end job

PROG1 starts, it sends a display/accept for parm 1 and gets back a 'Y' and then sends a display/accept for parm 2 and gets back an 'N'.

If the bat file contains the following, how do you get PROG1 to accept the run parameters. Adding the 2 parms under the bat file statement won't work. Can the run statement include something like "accept Y,N at start"

C:\\acucobol\\object\\PROG1.acu
I'm new to this arena, can you provide an example?

[Migrated content. Thread originally posted on 12 September 2008]

I'd like to have a bat file that runs a simple batch program but the program accepts parameters at run time from the bat file. Please forgive me but in what I'm used to, some JCL could be written with the following:

run prog1
Y
N
end job

PROG1 starts, it sends a display/accept for parm 1 and gets back a 'Y' and then sends a display/accept for parm 2 and gets back an 'N'.

If the bat file contains the following, how do you get PROG1 to accept the run parameters. Adding the 2 parms under the bat file statement won't work. Can the run statement include something like "accept Y,N at start"

C:\\acucobol\\object\\PROG1.acu
@echo off
set my-var=my-val
wrun32.exe Program1

You can adding pathing to this example, name it as a xxx.bat file and then lauch it from a command window.

[Migrated content. Thread originally posted on 12 September 2008]

I'd like to have a bat file that runs a simple batch program but the program accepts parameters at run time from the bat file. Please forgive me but in what I'm used to, some JCL could be written with the following:

run prog1
Y
N
end job

PROG1 starts, it sends a display/accept for parm 1 and gets back a 'Y' and then sends a display/accept for parm 2 and gets back an 'N'.

If the bat file contains the following, how do you get PROG1 to accept the run parameters. Adding the 2 parms under the bat file statement won't work. Can the run statement include something like "accept Y,N at start"

C:\\acucobol\\object\\PROG1.acu
Like I said, I'm new to this arena.
How does program1 get the value that's been 'set'

[Migrated content. Thread originally posted on 12 September 2008]

I'd like to have a bat file that runs a simple batch program but the program accepts parameters at run time from the bat file. Please forgive me but in what I'm used to, some JCL could be written with the following:

run prog1
Y
N
end job

PROG1 starts, it sends a display/accept for parm 1 and gets back a 'Y' and then sends a display/accept for parm 2 and gets back an 'N'.

If the bat file contains the following, how do you get PROG1 to accept the run parameters. Adding the 2 parms under the bat file statement won't work. Can the run statement include something like "accept Y,N at start"

C:\\acucobol\\object\\PROG1.acu
Working-Storage Section.
01 my-val pic x(20).

Procedure Division.

accept my-val from environment "my-val".

perform process-my-val-routine.

[Migrated content. Thread originally posted on 12 September 2008]

I'd like to have a bat file that runs a simple batch program but the program accepts parameters at run time from the bat file. Please forgive me but in what I'm used to, some JCL could be written with the following:

run prog1
Y
N
end job

PROG1 starts, it sends a display/accept for parm 1 and gets back a 'Y' and then sends a display/accept for parm 2 and gets back an 'N'.

If the bat file contains the following, how do you get PROG1 to accept the run parameters. Adding the 2 parms under the bat file statement won't work. Can the run statement include something like "accept Y,N at start"

C:\\acucobol\\object\\PROG1.acu
Working-Storage Section.
01 my-val pic x(20).

Procedure Division.

accept my-val from environment "my-val".

perform process-my-val-routine.

[Migrated content. Thread originally posted on 12 September 2008]

I'd like to have a bat file that runs a simple batch program but the program accepts parameters at run time from the bat file. Please forgive me but in what I'm used to, some JCL could be written with the following:

run prog1
Y
N
end job

PROG1 starts, it sends a display/accept for parm 1 and gets back a 'Y' and then sends a display/accept for parm 2 and gets back an 'N'.

If the bat file contains the following, how do you get PROG1 to accept the run parameters. Adding the 2 parms under the bat file statement won't work. Can the run statement include something like "accept Y,N at start"

C:\\acucobol\\object\\PROG1.acu
Working-Storage Section.
01 my-val pic x(20).

Procedure Division.

accept my-val from environment "my-val".

perform process-my-val-routine.

[Migrated content. Thread originally posted on 12 September 2008]

I'd like to have a bat file that runs a simple batch program but the program accepts parameters at run time from the bat file. Please forgive me but in what I'm used to, some JCL could be written with the following:

run prog1
Y
N
end job

PROG1 starts, it sends a display/accept for parm 1 and gets back a 'Y' and then sends a display/accept for parm 2 and gets back an 'N'.

If the bat file contains the following, how do you get PROG1 to accept the run parameters. Adding the 2 parms under the bat file statement won't work. Can the run statement include something like "accept Y,N at start"

C:\\acucobol\\object\\PROG1.acu
Success !
Thank you