Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

CONCATENATE-DISK-FILES

&pagelevel(3)&pagelevel

Join SAM files together

Component:

BS2000

Functional area:

File processing

Domain:

FILE                                                                                                            

Privileges:

STD-PROCESSING
TSOS

Function

The CONCATENATE-DISK-FILES command joins two or more SAM files together, concatenating them to form a single file. This is, however, conditional on the files all having matching FILE-STRUCTURE, BUFFER-LENGTH, RECORD-FORMAT, BLOCK-CONTROL-INFORMATION and CODED-CHARACTER-SET structure attributes. Files with a fixed record length (RECORD-FORMAT=FIXED) must have matching record lengths (RECORD-SIZE).
The target file is freely selectable, but by default the first of the files being concatenated is used as the target file. The command is rejected if the user does not have write permission for the target file.

Methodology

The files are copied record by record in the order specified in the FROM-FILES operand, with each appended file beginning in a separate data block. If an error (e.g. no read permission) occurs while copying is in progress, processing of the command aborts with an error code. If the target file (TO-FILE operand) has already been created, it will not be deleted.
A message provides information about the file which could not be processed.

Processing of encrypted files is possible only if the relevant crypto passwords are entered into the task’s crypto password table (see the ADD-CRYPTO-PASSWORD command).

Format

CONCATENATE-DISK-FILES                                                                                                                       

FROM-FILES = list-poss(255): <filename 1..54>

,TO-FILE = *FIRST-INPUT-FILE / <filename 1..54>

Operands

FROM-FILES = list-poss(255): <filename 1..54>
Defines the list of files which are to be copied, in the given order, to the file specified in the TO-FILE operand.

TO-FILE = *FIRST-INPUT-FILE / <filename 1..54>
Specifies the file to which the files specified in the FROM-FILE operand are to be copied. The command is rejected if the user does not have write permission for the target file.

TO-FILE = *FIRST-INPUT-FILE
The files specified in the FROM-FILES operand are to be copied to the first file listed in the FROM-FILES operand. In other words, the files following the first file are to be appended to the first file in the order specified in the FROM-FILES operand.

TO-FILE = <filename 1..54>
Specifies the name of the file to which the files specified in the FROM-FILES operand are to be copied. If a file with this name already exists, it will be overwritten.
If the file is one of the set specified in the FROM-FILES operand, it must be the first file listed there.

Return codes

(SC2)

SC1

Maincode

Meaning


0

CMD0001

Command successfully executed


64

CMD0202

Syntactical/semantic error in file name


64

DMS0681

DMS error during processing. For more detailed information the inserts can be queried using the chargeable product SDF-P

Example

/ass-syslst to=text.1,sys-num=1 —————————————————————————————————————————————— (1)
/ass-syslst to=text.2,sys-num=2
/ass-syslst to=text.3,sys-num=3

/wr-text 'We begin with TEXT.1 ... ́,output=*syslst(1) ———————————————————————— (2)
/wr-text ́ .... then comes TEXT.2 ... ́,output=*syslst(2)
/wr-text ́ .... and last there is TEXT.3! ́,output=*syslst(3)
/ass-syslst *primary,sys-num=1 ——————————————————————————————————————————————— (3)
/ass-syslst *primary,sys-num=2
/ass-syslst *primary,sys-num=3

/concat-disk-file from=(text.1,text.2,text.2,text.2,text.3),to=text.all —————— (4)

/sh-file text.all ———————————————————————————————————————————————————————————— (5)

 We begin with TEXT.1 ...
  .... then comes TEXT.2 ...
  .... then comes TEXT.2 ...
  .... then comes TEXT.2 ...
   .... and last there is TEXT.3!











%  SHO0301 WARNING: END OF FILE REACHED
                                                           S*SOF+     1(     1)
e
%  SHO0500  ́:1OSN:$USERXY01.TEXT.ALL ́ CLOSED

(1)

The SYSLST system file (SYSLST01, SYSLST02 and SYSLST03) is assigned to files TEXT.1, TEXT.2 and TEXT.3.

(2)

Using the WRITE-TEXT command, text is written to SYSLST01, SYSLST02 and SYSLST03 and hence to the assigned files TEXT.1, TEXT.2 and TEXT.3.

(3)

The system file assignment is canceled. As a result TEXT.1, TEXT.2 and TEXT.3 are closed and made accessible.

(4)

The CONCATENATE-DISK-FILES command is used to copy the contents of TEXT.1 once, TEXT.2 three times and TEXT.3 once to a file named TEXT.ALL.

(5)

The SHOW-FILE command displays the contents of TEXT.ALL. Output ends with statement “e” (END).