Highlighted
Absent Member.
Absent Member.
259 views

[archive] Temp BAT file variables

[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.
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Temp BAT file variables

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"
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Temp BAT file variables

Thanks, I'll try that
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.