The macro CALL "NDEL"... can be used to delete a file in a partner system. The functionality corresponds to that of the command DELETE-REMOTE-FILE.
Macro
The function can be called as follows:
CALL "NDEL" USING FT-NDEL-LIST FT-RETURN-INFO.
FT-NDEL-LIST
The range FT-NDEL-LIST describes the parameter list for the NDEL macro. FT-NDEL-LIST must be defined in the WORKING-STORAGE SECTION and can be copied to there with the statement
COPY FTNDEL OF linkname.
Before the first NDEL macro, the parameter fields should be deleted with the statement
MOVE LOW-VALUE TO USER-PARAMETERS IN FT-NDEL-LIST.
Before executing another NDEL macro, you must fill the desired fields. If a parameter is not specified or the default value is to be used, this field must be assigned the value LOW-VALUE.
FT-NDEL-LIST is defined as follows:
01 FT-NDEL-LIST. * 02 FILLER PIC X(4) VALUE "1000". * 02 USER-PARAMETERS. * 05 PARTNER-NAME PIC X(200). * 05 FILE-NAME PIC X(512). 88 NOT-SPECIFIED VALUE LOW-VALUE. * 05 FILE-PASSWORD PIC X(64). 88 NONE VALUE LOW-VALUE. 05 FILE-PASSWD-ATTR PIC X(1). 88 GRAPHIC VALUE LOW-VALUE. 88 OCTET VALUE "O". * 05 USER-DEF-ADMISSION PIC X(67). 88 NONE VALUE LOW-VALUE. 05 USER-DEF-ADM-ATTR PIC X(1). 88 GRAPHIC VALUE LOW-VALUE. 88 OCTET VALUE "O". 05 TRANSFER-ADMISSION. 10 USER-ID PIC X(67). 10 ACCOUNT PIC X(64). 88 NONE VALUE LOW-VALUE. 10 PASSWORD PIC X(64). 88 NONE VALUE LOW-VALUE.
05 USER-PASSWD-ATTR PIC X(1). 88 GRAPHIC VALUE LOW-VALUE. 88 OCTET VALUE "0".
The version specification at the beginning of the structure FT-NCOPY-LIST serves to identify the COPY element and must not be overwritten.
The NDEL macro does not change any values in the structure FT-NDEL-LIST.
The fields are to be written with left-justified characters and filled with right-justified blanks (default for the COBOL-MOVE statement for character strings).
Fields which should not contain any specifications are to be assigned LOW-VALUE.
If a parameter is not entered, the default values are generated as in the DELETE-REMOTE-FILE command.
All other values which should be set in quotation marks at the command interface do not have these quotation marks in the programming interface.
Passwords with integer values must be entered in binary form.
For the assignment of keywords, e.g. *NOT-SPECIFIED and *NONE, use the values which are set in the corresponding 88 step structure.
Description of the data fields
The parameters for FT-NDEL-LIST have the same names and functions as the operands for the command DELETE-REMOTE-FILE.
The parameter USER-DEF-ADM-ATTR is used to determine how the entry for USER-DEF-ADMISSION is to be interpreted. With the value GRAPHIC, the entry for USER-DEF-ADMISSION is interpreted as a printable character and converted for transfer to a system which does not use EBCDIC. With the value OCTET, the entry for USER-DEF-ADMISSION is interpreted as binary information and not converted.
Example NDEL
**************************************************************** * EXAMPLE: * * /DELETE-REMOTE-FILE PARTNER=VAR001,FILE-NAME=REMOTEFILE,- * * / TRANS=(USID,ACCOUNT,'PASSWORD') * * FROM A COBOL PROGRAM * **************************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. TESTNDEL. * ENVIRONMENT DIVISION. * CONFIGURATION SECTION. SPECIAL-NAMES. TERMINAL IS TERM. * DATA DIVISION. WORKING-STORAGE SECTION. 77 MAIN-RCODE-STRING PIC -ZZZZ9. 77 SUB-RCODE-STRING PIC -ZZZZ9. COPY FTNDEL OF FTLIB. COPY FTRETC OF FTLIB. * PROCEDURE DIVISION. STEUER SECTION. ST-01. * *SPECIFY PARAMETERS. MOVE LOW-VALUE TO USER-PARAMETERS. MOVE "VAR001" TO PARTNER-NAME. MOVE "REMOTEFILE" TO FILE-NAME. MOVE "USERID" TO USER-ID. MOVE "ACCOUNT" TO ACCOUNT. MOVE "'PASSWORD'" TO PASSWORD. * *NDEL-CALLING. CALL "NDEL" USING FT-NDEL-LIST FT-RETURN-INFO. * *RESULT-HANDLING. IF OKAY IN MAIN-RETURN-CODE THEN DISPLAY "NDEL OKAY" UPON TERM ELSE MOVE MAIN-RETURN-CODE TO MAIN-RCODE-STRING MOVE SUB-RETURN-CODE TO SUB-RCODE-STRING DISPLAY "NDEL REJECTED" UPON TERM DISPLAY "MAIN-RETURN-CODE: " MAIN-RCODE-STRING " SUB-RETURN-CODE: " SUB-RCODE-STRING UPON TERM. ST-99. STOP RUN.