CA MetaCOBOL+ program with LOCATE PHYSICAL and OBTAIN PHYSICAL

Document ID : KB000049495
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

We have a CA MetaCOBOL+ application program that does a "LOCATE PHYSICAL" on three tables in a CA Datacom/DB Database that has six Areas. It does an "OBTAIN PHYSICAL" on only the table with the largest record length of the three tables because it uses that record length as a template to put the other two tables in and then writes out any one of the three tables once it finds the record it wants.

My first question is:

We added a 4th table to this program but are unable to select/find any records on this new table, even though we know we have thousands of records.

My real question is:

Do all tables have to be in the same physical "Area" of a Database to do a "Locate/Obtain Physical?

Solution:

LOCATE PHYSICAL and OBTAIN PHYSICAL are Metacobol statements.

Their related Datacom/DB commands are respectively GSETP and GETPS.

LOCATE and OBTAIN PHYSICAL as well as other Metacobol statements can be found in CA-MetaCOBOL+ Program Development Reference CA-DATACOM/DB.
Their corresponding Datacom/DB commands can be found in the Appendix A for same manual.

GETPS and GSETP commands can be found in CA Datacom/DB Programming Guide.

"GETPS is a physical sequential command which retrieves the next physical record in an Area. Before using GETPS, issue a GSETP command to establish the table name and the associated elements that you want to retrieve."

"GSETP is a physical sequential command which you use to establish the table name and element list to set the start of a data area for physical block reads. Multiple tables in one area may participate in the record selection."

So the answer to your real question is:

YES, all the tables have to be in the same physical Area of a Database to do a "Locate/Obtain Physical".