Skip to main content

[archive] Temp BAT file variables

  • December 1, 2008
  • 2 replies
  • 0 views

[Migrated content. Thread originally posted on 26 November 2008]

Is there a way to set and read variables in a BAT file

Ex:
a batfile runs 2 programs.
Program 1 sets a variable (maybe thru an intrinsic call) to set VAR1=ABC
Program 1 ends and program 2 starts
Program 2 reads VAR1 to retrieve the value (ABC) set by program 1.

These would be temporary values known only to the bat file.

2 replies

[Migrated content. Thread originally posted on 26 November 2008]

Is there a way to set and read variables in a BAT file

Ex:
a batfile runs 2 programs.
Program 1 sets a variable (maybe thru an intrinsic call) to set VAR1=ABC
Program 1 ends and program 2 starts
Program 2 reads VAR1 to retrieve the value (ABC) set by program 1.

These would be temporary values known only to the bat file.
You can set environment variables and read environment variables in COBOL

set environment "VAR1" to "ABC".


01 my-data pic x(10).

accept my-data from environment "VAR1"

[Migrated content. Thread originally posted on 26 November 2008]

Is there a way to set and read variables in a BAT file

Ex:
a batfile runs 2 programs.
Program 1 sets a variable (maybe thru an intrinsic call) to set VAR1=ABC
Program 1 ends and program 2 starts
Program 2 reads VAR1 to retrieve the value (ABC) set by program 1.

These would be temporary values known only to the bat file.
Thanks, I'll try that