Jens Forsberg Trusted Contributor.
Trusted Contributor.
299 views

Project properties and directives

Jump to solution

I'm new to Visual COBOL and trying to figure out how to use (1) Project Properties, (2) Tools / Options / Micro Focus / Directives, (3) the $SET command and (4) the Application.Config file correctly.

The only project type I'm working with is INT/GNT. I use Visual Studio 2017 on Windows as IDE. I use Oracle's Pro*COBOL precompiler.

Here are some of my questions and thoughts.

1) By default VC seems to read the pcbcfg.cfg file in the [oracle]/precomp/admin. If I would like to have different cfg files for different situations, where do I put the directive to point to the cfg file I want to use?

2) In Project Properties - Application there is an Environment button. If you click on that you can enter differents settings. When do you want to do this and when will they be used?

3) In Project Properties - SQL there is an Add button for adding directives for the chosen preprocessor. But there is a textbox for "additional directives" as well. What is the difference?

4) In Project Properties - COBOL there is a textbox for "additional directives". When are you supposed to use this? In the same tab there is an "Advanced" button where you can enter copybook paths. What's the reason for this option when you already have the Copybooks tab?

5) When do you use the Application.Config file?

6) If you have multiple projects, is it then necessary to have one Application.Config file for each project or is it possible to have a common file? Or, in this case, should you put your common entries in Project Properties (if that is possible)?

7) When are you supposed to use Tools / Options / Micro Focus / Directives?

😎 There doesn't seem to be a way to add the P(CP) directive somewhere. Anyway, when I use the Determine Directives it gets added to the cblproj file. Is this the correct way to add the P(CP) directive?

9) Are you supposed to use the Windows environment variables as well? If so, when?

I have looked in Microsoft Help Viewer, but although there is a lot of information about this I can't find the answers to the questions above.

 

0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

Re: Project properties and directives

Jump to solution

@Jens Forsberg wrote:

4) In Project Properties - COBOL there is a textbox for "additional directives". When are you supposed to use this? In the same tab there is an "Advanced" button where you can enter copybook paths. What's the reason for this option when you already have the Copybooks tab?

There are several ways to set directives, and the additional directives field allows you to set the directives from the project level.

As for the Advanced COBOL settings, there is no need to use this setting if you're already using the Copypooks properties.

–Ғɑɳօ
0 Likes
4 Replies
Micro Focus Expert
Micro Focus Expert

Re: Project properties and directives

Jump to solution

@Jens Forsberg wrote:

1) By default VC seems to read the pcbcfg.cfg file in the [oracle]/precomp/admin. If I would like to have different cfg files for different situations, where do I put the directive to point to the cfg file I want to use?

VC doesn't read the pcbcfg.cfg file. It interacts with the Oracle Pro*COBOL precompiler that reads this .cfg file. I'm not sure what environment variable should be used to point to a .cfg file in a different location. You should consult the Oracle documentation.

–Ғɑɳօ
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Project properties and directives

Jump to solution

@Jens Forsberg wrote:

2) In Project Properties - Application there is an Environment button. If you click on that you can enter differents settings. When do you want to do this and when will they be used?

Any environment variables that you set in this setting will be only visible to the current project.

It is common to define a data file in an environment variable that is read by a program, and this gives a flexibity to the program to work with different data files by simply changing the value of the environment variable.

–Ғɑɳօ
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Project properties and directives

Jump to solution

@Jens Forsberg wrote:

3) In Project Properties - SQL there is an Add button for adding directives for the chosen preprocessor. But there is a textbox for "additional directives" as well. What is the difference?

The additional directives field is disabled, so it's not possible to add any additional directives. If you look in the COBOL and COBOL Link properties, this field is enabled to allow you to add other directives.

I suppose all three (SQL, COBOL, COBOL Link) properties are using the same setting template, and the additional directives field had to be disabled in the SQL one as it's not used.

–Ғɑɳօ
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Project properties and directives

Jump to solution

@Jens Forsberg wrote:

4) In Project Properties - COBOL there is a textbox for "additional directives". When are you supposed to use this? In the same tab there is an "Advanced" button where you can enter copybook paths. What's the reason for this option when you already have the Copybooks tab?

There are several ways to set directives, and the additional directives field allows you to set the directives from the project level.

As for the Advanced COBOL settings, there is no need to use this setting if you're already using the Copypooks properties.

–Ғɑɳօ
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.