Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

EXTRACT-FILE

&pagelevel(4)&pagelevel

This statement extracts files from the currently opened ZIP file.

EXTRACT-FILE

FILE-NAME = *ALL / <composed-name 1..98 with-under with-wild(132)> / <c-string 1..1024 with-low> / *PATH-NAME(...)

*PATH-NAME(...)


|PATH=<c-string 1..1800 with-low>
, TO-FILE = *BY-SOURCE / <filename 1..54 without-gen-vers with-wild-constr(80)>
, WRITE-MODE = *CREATE / *REPLACE-ONLY / *ANY
, DATA-TYPE = *NOT-SPECIFIED / *CHARACTER / *BINARY / *SAM-BINARY
, CHARACTER-CONVERSION = *BY-CONTAINER-FORMAT / *NO / *TO-WIN-ANSI / *TO-EBCDIC / *BY-PARAMETERS(...)

*BY-PARAMETERS(...)


| FROM-CCS = WCP1252P / < name 1..8>


| TO-CCS = EDF04F / < name 1..8>
, BLOCK-CONTROL-INFO = *KEEP / *IGNORE
,LOGGING = *MINIMUM / *MAXIMUM

FILE-NAME = *ALL
All the files included in the container are extracted.

FILE-NAME = <composed-name 1..98 with-under with-wild(132)>
The specified file is extracted from the container. When wildcards are used, all files matching the pattern are extracted from the container.

FILE-NAME = <c-string 1..1024 with-low>
All files which match the specified string (wildcards according to the SDF rules for wildcard selection (see SDF syntax in the “Commands” manual [2]) are permitted) are extracted from the ZIP container. Specification as a C string must be used if the container was created in a non-BS2000 system and the file names concerned do not comply with BS2000 syntax (e.g. upper/lower case).

FILE-NAME = *PATH-NAME(...)

The specified file is extracted from the container. The operand will not interpret characters like forward slash, asterisk, square brackets and others as wildcards, but as part of the filename. Use this operand to specify a relative path name inside of the ZIP container.

TO-FILE = *BY-SOURCE / <filename 1..54 without-gen-vers with-wild-constr(80)>According to the origin of the zipped files, the output name will respect the following rules:

    • For BS2000 files, the output name is built according to the SDF rules for wildcard construction (see SDF syntax in the “Commands” manual [2]).

    • For other files (PC, Unix system), the output name is built by replacing the '*' character in the TO-FILE operand by the file name registered in the container. The eventual path of the file is ignored in the file name construction process..

      TO-FILE=

      File origin BS2000

      File origin not BS2000

      *BY-SOURCE

      The output file name will be the file name as registered in the container.

      • If the file has been registered with a catid/userid, it will be extracted under this catid/userid.

      • If the file has been registered without catid/userid, it is extracted under the current userid/catid.

      The output filename will be the file name without access path prefixed by the current catid/userid.
      File names which do not comply with the syntax in BS2000 are renamed by BS2ZIP (see below).

      <filename 1..54 without-gen-vers with-wildconstr(80)>

      Valid format is:

      • a file name without wildcard.

      • a file name with wildcards:
        the output name is built according to the SDF rules for wildcard construction.
        If the new file name does not respect BS2000 syntax, the extract of the file is rejected.

      Valid format is:

      • a file name without wildcard.

      • [<PREFIX>]*[<SUFFIX>]: the output file name will be [<PREFIX>]filename[<SUFFIX>] where file name is the registered file name without directory path.
        If the resultant file name does not comply with the syntax in BS2000, it is renamed by BS2ZIP (see below).

      If some zipped file names are not BS2000 compliant, it is necessary to extract them one by one, specifying for each of them a valid output name. If extraction results in an invalid file name, the file concerned is assigned the following alternative file name:

      FILExxxx.yyyymmdd.hhmmss

      where xxxx is a sequence number, yyyymmdd.hhmmss is the current date and time. BS2ZIP shows that the file has been renamed with the message SZP0090. Example:

      % SZP0090 Warning. File name 'TEST_KDO_1.HTM' is not BS2000 compliant.

      The file will be extracted under the name 'FILE0001.20111108.161442'

      The catid /userid of those files are taken from the <PREFIX>. If they are not specified the catid/userid of the current user are used by default.



WRITE-MODE = *CREATE
The output file must not exist and is created. The statement is rejected if the file exists already.

WRITE-MODE = *REPLACE-ONLY
The output file must exist and is replaced. The statement is rejected if the file does not exist.

WRITE-MODE = *ANY
The output file is overwritten if exists or created otherwise.

DATA-TYPE =
This operand controls the record structur of the files to be extracted.

DATA-TYPE

Container format
WINZIP
compatible

Container format
BS2000

*NOT-SPECIFIED

If no file info found in ZIP container
then *CHARACTER is assumed.
Else file info is used and character conversion is done or not according to file type and CHARACTER-CONVERSION operand

If no file info found
Then error
Else file info is used - no conversion

*CHARACTER

File is extracted as a SAM file
Records are assumed to be delimited by 0D0A
Character conversion is performed according to the CHARACTER-CONVERSION operand

Statement rejected

*BINARY

File is extracted as a PAM file
No conversion is performed.
In case of original PAM files, the extract is rejected with error message SZP0121

Statement rejected

*SAM-BINARY

File is extracted as a binary SAM file (REC-FORM=U)
No conversion performed

Statement rejected

CHARACTER-CONVERSION =
This operand controls the WIN-ANSI/EBCDIC conversion. It is only supported when extracting from a WINZIP-COMPATIBLE container and for the following files:

    • files extracted with DATA-TYPE=*CHARACTER

    • files extracted with DATA-TYPE=*NOT-SPECIFIED and which are not indicated as PAM file in the file-info.

CHARACTER-CONVERSION

Conversion behaviour

*BY-CONTAINER-FORMAT

Default value. Behavior determined by the ZIP container open format

*NO

No conversion is forced

*TO-WIN-ANSI

WIN-ANSI conversion is forced (only for extraction to SAM/ISAM file)

*TO-EBCDIC

EBCDIC conversion is forced (only for extraction to SAM/ISAM file)

*BY-PARAMETERS(...)Conversion will be made according to specified source and target character sets (only for extraction to SAM/ISAM file)

*FROM-CCSOrigin coded character set, from which all characters will be converted.
Supported coded character sets: WCP1252P, UTF8, ISO88591, ISO8859F (XHCS names, see manual XHCS [5])

*TO-CCSTarget coded character set, to which all characters will be converted.
Supported coded character sets: EDF04F, EDF041, EDF03DRV, EDF03IRV, EDF04DRV, EDF04IRV (XHCS names, see manual XHCS [5])


BLOCK-CONTROL-INFO =
Controls the block control attribute of the resulting file. This allows particularly to extract original PAMKEY file on a NK disk.

BLOCK-CONTROL-INFO = *KEEP
The resulting file keeps the same block control attribute than the original file

BLOCK-CONTROL-INFO = *IGNORE
The resulting file is created with the default block control of the disk where it is saved.

Notes

    • If data encryption had been set using the MODIFY-ZIP-OPTIONS statement, encrypted files are decrypted again when they are extracted. The standard Zip 2.0 encryption used here is compatible with WinZip on Windows-based systems.

    • Files extracted from a container created on the BS2000, are created with the same organization characteristics as the original file, except the padding factor and blockcontrol. The padding factor is the default DMS padding value. This implies that the size of extracted SAM and ISAM file can be different from the size of the original files.

    • Files extracted from a container created in a foreign environment, are created

      • as SAM files with BUF-LEN=STD(16), provided that DATA-TYPE=*NOT-SPECIFIED or *CHARACTER,

      • as PAM files with BUF-LEN=STD(16) provided that DATA-TYPE=*BINARY and

      • as SAM files with REC-FORM=U provided that DATA-TYPE=*SAM-BINARY.

    • K and NK disks

      • When a zipped file with PAMKEY block control has to be extracted on a NK disk, use the operand BLOCK-CONTROL-INFO=*IGNORE. The file will be converted into NK format. However, in case of SAM or ISAM files with records occupying all the available space in blocks, data truncation will occur. In this case, an error will be detected and the extract processing is aborted for the current file. The output file is erased.

      • To extract NK disk files (especially load modules), that have been added to a container, on a PAMKEY disk, the option BLOCK-CONTROL-INFO=*KEEP must be set.

    • If the K2 key is pressed during EXTRACT-FILE statement, processing is interrupted with the query message SZP0208:

      • The user can simply continue processing.

      • The user can terminate processing and return to statement mode (//). The files which had not been added by the time the interruption occurred are not extracted. If required, they must be extracted again.

    • To select files from an archive coming from a foreign platform, take into account that the registered file names are case sensitive. So, use the c-string format to select filenames containing lower cases.

    • Rules for naming extracted files:

      BS2000 files:
      (please refer to SDF rules for wildcard construction in the “Commands” manual [2])

      FILE-NAME

      TO-FILE

      Registered file names

      Resulting file names 1

      MYFILE1

      *BY-SOURCE

      MYFILE1

      :ccid:$cuid.MYFILE1

      *

      *BY-SOURCE

      MYFILE1
      MYFILE2

      :ccid:$cuid.MYFILE1
      :ccid:$cuid.MYFILE2

      MY*

      EXT-*

      MYFILE1
      MYFILE2

      :ccid:$cuid.EXT-FILE1
      :ccid:$cuid.EXT-FILE2

      MYFILE1

      *BY-SOURCE

      :XXXX:$UID.MYFILE1

      No file found

      :XXXX:$UID.

      *BY-SOURCE

      :XXXX:$UID.MYFILE1

      :XXXX:$UID.MYFILE1

      $UID.

      *BY-SOURCE

      $UID.MYFILE1

      :ccid:$UID.MYFILE1

1where $cuid = current userid and :ccid: = catid of the userid

Not BS2000 files:

FILE-NAME

TO-FILE

Registered file names

Resulting file names 1

MYFILE1

*BY-SOURCE

/temp/data/myfile.txt

No file found

*

*BY-SOURCE

/temp/data/myfile1.txt
/temp/data/myfile2.txt

:ccid:$cuid.MYFILE1.TXT
:ccid:$cuid.MYFILE2.TXT

'*myfile*'

EXT-*

/temp/data/myfile1.txt
/temp/data/myfile2.txt

:ccid:$cuid.EXT-MYFILE1.TXT
:ccid:$cuid.EXT-MYFILE2.TXT

1where $cuid = current userid and :ccid: = catid of the userid


LOGGING = *MINIMUM / *MAXIMUM
Controls the amount of the message output.

LOGGING = *MINIMUM
Only error messages will be sent.

LOGGING =*MAXIMUM
All messages will be sent. Currently the [guaranteed] message SZP0122 is sent after each file extraction; further messages may be added in the future.