OSI/FTAM Programming Reference Manual

FTM Procedures
HP NonStop OSI/FTAM Programming Reference Manual528611-001
4-73
FTM_ERASE_REQ_
Example
The following TAL program illustrates the use of the FTM_ERASE_REQ_ procedure
call:
1. !-----------------------------------------------------------------------!
2. ! This example demonstrates how to erase the contents of an FTAM-2 !
3. ! file. It assumes that the file has already been selected and !
4. ! opened. !
5. ! !
6. ! This example abends on all error conditions. Additional application- !
7. ! specific error handling or recovery could be implemented if !
8. ! required by an application. !
9. !-----------------------------------------------------------------------!
10. LITERAL WAIT_FOREVER = -1d; ! Timeout for event rcv. !
11. STRUCT .EXT diag ( ZFTM^DDL^DIAGNOSTIC^DEF ); ! FTAM diagnostics !
12. STRUCT .EXT fadu_id ( ZFTM^DDL^FADU^ID^DEF ); ! FADU to be erased !
13. INT(32) .EXT action_result; ! Result of erase req. !
14. INT cepi; ! Connection endpoint ID !
15. INT status; ! APS status code !
16. INT event_code; ! OSI/FTAM event code !
17. INT error; ! APS or FTAM error code !
18. !----------------------------------------------------------------------!
19. ! Insert code to initialize APS, make FTAM association, and select and |
20. | open file. |
21. !----------------------------------------------------------------------!
22. ! Specify the target FADU. For an FTAM-2 file, the FADU ID !
23. ! for an erase request must be the "begin" FADU. !
24. !----------------------------------------------------------------------!
25. fadu_id.zid := zftm^val^faduid^beginend;
26. fadu_id.zbeginend := zftm^val^faduid^begin;
27. !----------------------------------------------------------------------!
28. ! Call FTM_ERASE_REQ_ to erase the FADU from the file. !
29. ! This will erase the entire file. !
30. !----------------------------------------------------------------------!
31. status := FTM_ERASE_REQ_ ( cepi
32. , fadu_id
33. , ! tag ! );
34. IF ( status <> ZAPS^VAL^STATUS^OK ) THEN
35. BEGIN
36. CALL ABEND;