Skip to main content

Hi,

I'm trying to fetch a Micro focus COBOL-DB2 (SQL server) Cursor and encounter the error, "Load error : file 'FETCH' error code: 173, pc=0, call=1, seg=0 173 Called program file not found in drive/directory". There are other Cursors in the same program and they seem to be working file. Can someone please help? 

CURSOR:

EXEC SQL DECLARE STYLE_COUNTS CURSOR FOR

SELECT SYSTEM_TYPE
,STORE_RCVR_NUM
,STORE_PO_NUM
,STORE_NUM
,STYLE_NUM
,SUM(AVAILABLE_UNITS)
,SUM(AVAILABLE_UNITS * ITEM_COST)
,SUM(AVAILABLE_UNITS * ITEM_RETAIL)
FROM INV_AVAIL_ITEM
WHERE STORE_RCVR_NUM = :WS-PREV-RECEIVER-NUM
GROUP BY SYSTEM_TYPE
,STORE_RCVR_NUM
,STORE_PO_NUM
,STORE_NUM
,STYLE_NUM
END-EXEC.


#fetch
#MicroFocus
#call
#DLLError
#SQL
#VisualCOBOL

Hi,

I'm trying to fetch a Micro focus COBOL-DB2 (SQL server) Cursor and encounter the error, "Load error : file 'FETCH' error code: 173, pc=0, call=1, seg=0 173 Called program file not found in drive/directory". There are other Cursors in the same program and they seem to be working file. Can someone please help? 

CURSOR:

EXEC SQL DECLARE STYLE_COUNTS CURSOR FOR

SELECT SYSTEM_TYPE
,STORE_RCVR_NUM
,STORE_PO_NUM
,STORE_NUM
,STYLE_NUM
,SUM(AVAILABLE_UNITS)
,SUM(AVAILABLE_UNITS * ITEM_COST)
,SUM(AVAILABLE_UNITS * ITEM_RETAIL)
FROM INV_AVAIL_ITEM
WHERE STORE_RCVR_NUM = :WS-PREV-RECEIVER-NUM
GROUP BY SYSTEM_TYPE
,STORE_RCVR_NUM
,STORE_PO_NUM
,STORE_NUM
,STYLE_NUM
END-EXEC.


#fetch
#MicroFocus
#call
#DLLError
#SQL
#VisualCOBOL

On what platform is this, Windows, Linux?
Are you using the OpenESQL preprocessor for ODBC for SQL Server?

The error is what would normally occur if you did a CALL to a program called FETCH and it didn't exist.

Can you show me what the FETCH statement looks like and if you single step thru the program in debug mode does this error occur directly on the FETCH statement?

Thanks


On what platform is this, Windows, Linux?
Are you using the OpenESQL preprocessor for ODBC for SQL Server?

The error is what would normally occur if you did a CALL to a program called FETCH and it didn't exist.

Can you show me what the FETCH statement looks like and if you single step thru the program in debug mode does this error occur directly on the FETCH statement?

Thanks

Thanks Chris! This is a on Windows platform. 

I put a display after the Fetch and that didn't get displayed. The program fails immediately after executing the Fetch, even the SQL code error handling section doesn't get executed. 

EXEC FETCH STYLE_COUNTS
INTO :WS-ASTY-SYSTEM-TYPE
,:WS-ASTY-RCVR-NUM
,:WS-ASTY-PO-NUM
,:WS-ASTY-STORE-NUM
,:WS-ASTY-STYLE-NUM
,:WS-ASTY-STYLE-START-UNITS
,:WS-ASTY-STYLE-START-COST
,:WS-ASTY-RETL-AMT-UNITS
END-EXEC.

What puzzles me is that there is a Cursor before this one and it seems to work as expected. I checked to make sure the Cursor is opened and is successful before executing this fetch.

Thanks,

Prabhu


Thanks Chris! This is a on Windows platform. 

I put a display after the Fetch and that didn't get displayed. The program fails immediately after executing the Fetch, even the SQL code error handling section doesn't get executed. 

EXEC FETCH STYLE_COUNTS
INTO :WS-ASTY-SYSTEM-TYPE
,:WS-ASTY-RCVR-NUM
,:WS-ASTY-PO-NUM
,:WS-ASTY-STORE-NUM
,:WS-ASTY-STYLE-NUM
,:WS-ASTY-STYLE-START-UNITS
,:WS-ASTY-STYLE-START-COST
,:WS-ASTY-RETL-AMT-UNITS
END-EXEC.

What puzzles me is that there is a Cursor before this one and it seems to work as expected. I checked to make sure the Cursor is opened and is successful before executing this fetch.

Thanks,

Prabhu

This has been resolved. I was missing the "SQL" key word in the Fetch statement and that created this issue. thanks for your help!