OSI/FTAM Programming Reference Manual

FTM Procedures
HP NonStop OSI/FTAM Programming Reference Manual528611-001
4-109
FTM_LOCATE_REQ_
Example
The following TAL program illustrates the use of the FTM_LOCATE_REQ_ procedure
call:
1. !-----------------------------------------------------------------------!
2. ! This example demonstrates how to locate a record of an FTAM-2 file. !
3. ! It assumes that the file has already been selected and opened. !
4. ! !
5. ! This example abends on all error conditions. Additional application- !
6. ! specific error handling or recovery could be implemented if !
7. ! required by an application. !
8. !-----------------------------------------------------------------------!
9. LITERAL WAIT_FOREVER = -1d; ! Timeout for event rcv. !
10. STRUCT .EXT diag ( ZFTM-DDL-DIAGNOSTIC-DEF ); ! FTAM diagnostics !
11. STRUCT .EXT fadu_id ( ZFTM-DDL-FADU-ID-DEF ); ! FADU to be located !
12. INT(32) .EXT action_result; ! Result of locate req. !
13. INT cepi; ! Connection endpoint ID !
14. INT status; ! APS status code !
15. INT event_code; ! OSI/FTAM event code !
16. INT error; ! APS or FTAM error code !
17. !----------------------------------------------------------------------!
18. ! Specify the target FADU. This example locates the first record in an !
19. ! FTAM-2 file. !
20. !----------------------------------------------------------------------!
21. fadu_id.zid := zftm-val-faduid-firstlast;
22. fadu_id.zfirstlast := zftm-val-faduid-first;
23. !----------------------------------------------------------------------!
24. ! Call FTM_LOCATE_REQ_ to locate the FADU. !
25. !----------------------------------------------------------------------!
26. status := FTM_LOCATE_REQ_ ( cepi
27. , fadu_id
28. , ! tag ! );
29. IF ( status <> ZAPS-VAL-STATUS-OK ) THEN
30. BEGIN
31. CALL ABEND;
32. END;
33. !----------------------------------------------------------------------!
34. !Call APS_EVENT_RECEIVE_ to receive the confirm for the locate service.!
35. !----------------------------------------------------------------------!
36. status := APS_EVENT_RECEIVE_ ( cepi, WAIT_FOREVER );