Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

CHANGE-FILE-LINK

&pagelevel(3)&pagelevel

Change file link name

Component:

BS2000

Functional area:

File processing

Domain:

FILE

Privileges:

STD-PROCESSING
SAT-FILE-EVALUATION
SAT-FILE-MANAGEMENT

Function

The CHANGE-FILE-LINK command changes the file link name in an existing entry in the Task File Table (TFT), i.e. it assigns a new file link name to the file. All the other values in this TFT entry will remain unchanged.

The CHANGE-FILE-LINK command cannot be applied to the TFT entry of a file that is currently open. The ADD-FILE-LINK command can be used to create a new TFT entry; the SHOW-FILE-LINK command returns information on existing TFT entries.

Format

CHANGE-FILE-LINK                                                                                                             

Alias: CGFL

LINK-NAME = *FIRST-BLANK / <filename 1..8 without-gen>

,NEW-NAME = <filename 1..8 without-gen>

Operands

LINK-NAME = *FIRST-BLANK / <filename 1..8 without-gen>
Specifies the existing link name of the file.

LINK-NAME = *FIRST-BLANK
If *FIRST-BLANK is specified, the first TFT entry with a link name consisting of blanks is selected for change. Such an entry is created if neither the link name nor the file name is defined in the FCB macro call of a program and if no appropriate ADD-FILE-LINK command is issued before the program call. The file name in this entry is the symbolic name of the FCB macro call.

LINK-NAME = <filename 1..8 without-gen>
Specifies the existing link name of the file.

NEW-NAME = <filename 1..8 without-gen>
The new link name to be given to the file.

Return codes

(SC2)

SC1

Maincode

Meaning


0

CMD0001

Command executed


1

CMD0202

Syntactical or semantic error in command


64

DMS05D5

Specified LINK name missing or invalid


64

DMS05DD

New LINK name already exists


64

DMS06FF

BCAM connection severed


130

DMS0582

File is currently locked or being used and cannot be processed

Example

Changing a file link name

/show-file-attr max.file.2,inf=(org=*yes)   ——————————————————————————        (1)

%0000000003 :2OSG:$USER1.MAX.FILE.2
%  ------------------------------- ORGANIZATION ------------------------------- 
%  FILE-STRUC = NONE        BUF-LEN    = NONE        BLK-CONTR  = NONE
%  IO(USAGE)  = READ-WRITE  IO(PERF)   = STD         DISK-WRITE = IMMEDIATE
%  REC-FORM   = NONE        REC-SIZE   = 0
%  AVAIL      = *STD
%  WORK-FILE  = *NO         F-PREFORM  = *K          S0-MIGR    = *ALLOWED
%:2OSG: PUBLIC:      1 FILE  RES=         3 FRE=         3 REL=         3 PAGES 

/add-file-link link=pcin,file-name=max.file.2    —————————————————————————   (2)
/add-file-link link=pcout,file-name=max.file.9,access-method=*isam,
         support=*disk(isam-attr=(key-pos=10,key-len=4)) ——————————————————— (3)
/start-percon   ———————————————————————————————————————————————————————————— (4)

%  BLS0523 ELEMENT 'PCROOT', VERSION '029', TYPE 'L' FROM LIBRARY ':1OSH:$TSOS.S
YSLNK.PERCON.029' IN PROCESS
%  BLS0524 LLM 'PCROOT', VERSION '02.9A' OF '2008-10-06 14:27:00' LOADED
%  BLS0551 COPYRIGHT (C) FUJITSU TECHNOLOGY SOLUTIONS 2009. ALL RIGHTS RESERVED 
%  PER0000 PERCON STARTED, VERSION V02.9A10

%//assign-input-file file=*disk-file    —————————————————————————————————    (5)
%//assign-output-file file=*disk-file   ———————————————————————————————————  (6)
%//start-conv ————————————————————————————————————————————————————————————   (7)

%  PER0030 NUMBER OF PROCESSED RECORDS FOR LINK='PCIN' (FILE=:2OSG:$USER1.MAX
.FILE.2):          9
%  PER0030 NUMBER OF PROCESSED RECORDS FOR LINK='PCOUT' (FILE=:2OSG:$USER1.MA
X.FILE.9):          9

%//end  ———————————————————————————————————————————————————————————————————— (8)

%  PER0031 PERCON TERMINATED NORMALLY

/show-file-link  ——————————————————————————————————————————————————————————  (9)

%   PCIN                :2OSG:$USER1.MAX.FILE.2
%   PCOUT               :2OSG:$USER1.MAX.FILE.9

/show-file-link link=pcout,inf=(file-control-block=*yes)  ————————————————  (10)

%
%-- LINK-NAME --------- FILE-NAME ---------------------------------------------
%   PCOUT               :2OSG:$USER1.MAX.FILE.9
%  -------------------- FILE-CONTROL-BLOCK - GENERAL ATTRIBUTES -------------
%  ACC-METH   = ISAM        OPEN-MODE  = *BY-PROG    REC-FORM   = *BY-PROG
%  REC-SIZE   = *BY-PROG    BUF-LEN    = *BY-PROG    BLK-CONTR  = *BY-PROG
%  F-CL-MSG   = STD         CLOSE-MODE = *BY-PROG
%  -------------------- FILE-CONTROL-BLOCK - DISK FILE ATTRIBUTES -----------
%  SHARED-UPD = *BY-PROG    WR-CHECK   = *BY-PROG    IO(PERF)   = *BY-PROG
%  IO(USAGE)  = *BY-PROG    LOCK-ENV   = *BY-PROG
%  -------------------- FILE-CONTROL-BLOCK - TAPE FILE ATTRIBUTES -----------
%  LABEL      = *BY-PROG   (DIN-R-NUM  = *BY-PROG,   TAPE-MARK  = *BY-PROG)
%  CODE       = *BY-PROG    EBCDIC-TR  = *BY-PROG    F-SEQ      = *BY-PROG
%  CP-AT-BLIM = *BY-PROG    CP-AT-FEOV = *BY-PROG    BLOCK-LIM  = *BY-PROG
%  REST-USAGE = *BY-PROG    BLOCK-OFF  = *BY-PROG    TAPE-WRITE = *BY-PROG
%  STREAM     = *BY-PROG
%  -------------------- FILE-CONTROL-BLOCK - ISAM FILE ATTRIBUTES -----------
%  KEY-POS    = 10          KEY-LEN    = 4           POOL-LINK  = *BY-PROG
%  LOGIC-FLAG = *BY-PROG    VAL-FLAG   = *BY-PROG    PROPA-VAL  = *BY-PROG
%  DUP-KEY    = *BY-PROG    PAD-FACT   = *BY-PROG    READ-I-ADV = *BY-PROG
%  WR-IMMED   = *BY-PROG    POOL-SIZE  = *BY-PROG

/show-file-attr max.file.9,inf=(org=*yes)   ——————————————————————————————  (11)

%00000003 :2OSG:$USER1.MAX.FILE.9
%  ------------------------------- ORGANIZATION -------------------------------
%  FILE-STRUC = ISAM        BUF-LEN    = STD(1)      BLK-CONTR  = PAMKEY
%  IO(USAGE)  = READ-WRITE  IO(PERF)   = STD         DISK-WRITE = IMMEDIATE
%  REC-FORM   = (V,N)       REC-SIZE   = 0
%  KEY-LEN    = 4           KEY-POS    = 10
%  AVAIL      = *STD
%:2OSG: PUBLIC:      1 FILE  RES=        3  FRE=         1  REL=        0 PAGES

/change-file-link link=pcout,new-name=edtisam  ———————————————————————————— (12)
/show-file-link  —————————————————————————————————————————————————————————— (13)

%
%-- LINK-NAME --------- FILE-NAME ---------------------------------------------
%   EDTISAM             :2OSG:$USER1.MAX.FILE.9
%   PCIN                :2OSG:$USER1.MAX.FILE.2

/start-edt   —————————————————————————————————————————————————————————————  (14)

.
.
. "Processing with the EDT utility routine"
.
.

/remove-file-link link=ed  ———————————————————————————————————————————————  (15)

(1)

Output of the organization attributes of the SAM file MAX.FILE.2.

(2)

Creates a TFT entry for the file MAX.FILE.2 under the link name PCIN (default link name of the utility routine PERCON for the input file).

(3)

Creates a TFT entry for the file MAX.FILE.9 under the link name PCOUT (default link name of the utility routine PERCON for the output file). The file MAX.FILE.2 is to be converted with the PERCON utility to the ISAM file MAX.FILE.9 by constructing the ISAM key from the data bytes 6 to 9.

(4)

Invocation of the PERCON utility routine.

(5)

The file that is entered into the TFT with the default link name PCIN is to be used as the input file.

(6)

The file that is entered into the TFT with the default link name PCOUT is to be used as the output file.

(7)

The conversion begins.

(8)

The PERCON utility routine is terminated.

(9)

The output of the TFT entries indicates that the entries with link names PCIN and PCOUT still exist.

(10)

Output of the TFT entry with the link name PCOUT showing the file organization attributes.

(11)

Output of the file organization attributes from the catalog entry of the file MAX.FILE.9.

(12)

In order to enable processing of the file MAX.FILE.9 with the utility routine EDT, the link name PCOUT is changed to EDTISAM with the CHANGE-FILE-LINK command. This makes it possible to process the existing TFT entry for the file MAX.FILE.9 with the utility routine EDT via the default link name EDTISAM (without the TFT entry, EDT only processes ISAM files with KEY-POS=5 and KEY-LENGTH=8). It is not necessary to create a new TFT entry with ADD-FILE-LINK.

(13)

The output of the TFT entries indicates that the entries with the link names PCIN and EDTISAM exist.

(14)

Invocation of the utility routine EDT.

(15)

After processing in the EDT is complete, the TFT entry with the link name EDTISAM is deleted.