If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
I do not know at program exection time the library of the data area. This is defined within the program.
What is “defined” within the program? The library that contains the data area?
What exactly is the problem you need to solve? Are you trying to locate the data area? Are you certain that there will be only one? If there are others, is there a way to recognize the differences? If a testing library exists on the system and it has a duplicate of the data area (same name!), can you tell that it’s not the right one?
Not sure what you are asking for here. If the pgm creates the DTAARA, you should know which library it is in I hope. Like CharlieBrowne says “NEVER hard code a LIBRARY in a pgm” it will always cause problems in the future.
You should NEVER hardcode a library name in a program.
…except when necessary. In the vast majority of cases, particularly home-grown software development, it shouldn’t be necessary. But there are circumstances where you do not want external control to change what a program accesses.
Just let it difault to *LIBL
…unless the library isn’t in *LIBL.
In the case of the question, the function probably involves access through the HTTP server. It’s very likely that *LIBL won’t help.
But perhaps an external object such as a job description could be retrieved. Job descriptions are handy for storing lists of libraries. The function could retrieve a list of libraries and search for the data area within that list. That allows the list to be maintained outside of the program.
I do not know at program exection time the library of the data area. This is defined within the program.
What is “defined” within the program? The library that contains the data area?
What exactly is the problem you need to solve? Are you trying to locate the data area? Are you certain that there will be only one? If there are others, is there a way to recognize the differences? If a testing library exists on the system and it has a duplicate of the data area (same name!), can you tell that it’s not the right one?
What is your question?
Tom
You should NEVER hardcode a library name in a program.
Just let it difault to *LIBL
Not sure what you are asking for here. If the pgm creates the DTAARA, you should know which library it is in I hope. Like CharlieBrowne says “NEVER hard code a LIBRARY in a pgm” it will always cause problems in the future.
You should NEVER hardcode a library name in a program.
…except when necessary. In the vast majority of cases, particularly home-grown software development, it shouldn’t be necessary. But there are circumstances where you do not want external control to change what a program accesses.
Just let it difault to *LIBL
…unless the library isn’t in *LIBL.
In the case of the question, the function probably involves access through the HTTP server. It’s very likely that *LIBL won’t help.
But perhaps an external object such as a job description could be retrieved. Job descriptions are handy for storing lists of libraries. The function could retrieve a list of libraries and search for the data area within that list. That allows the list to be maintained outside of the program.
Tom
Run the program In debug mode. Step through to see where the dtaarea is created.
Hi,
In V5R4 you can use
DTAARA(*VAR:var_with_data_area_name)
var_with_data_area_name can use any of the following formats
dtaaraname
libname/dtaaraname
*LIBL/dtaaraname
Regards,
Wilson