![]() |
- AD: Arrange Data (Select column ranges for display)
AD { [col | const | seq] ["text"] } {, ... } ... [, FC= X'cc' | C'c']
Arrange Data. The Display mode of the file is changed such that only certain column ranges of the records are selected, and are displayed in a particular sequence. Character strings can be inserted between the column ranges. The display of each individual column can be in either character or hexadecimal format. Descriptive text can be assigned to each selected column range in the Scale line. Only the display of the file records is influenced by the AD command. The file itself remains unchanged.
col Value for the selected column range. Two different selection methods are possible.
:col1: len [B[S]|C|H|P[n]|Z]
First column in the required range. The column numbering begins with column 1.
len
Length of the column range.
:col1-col2: [B[S]|C|H|P[n]|Z|STCK]
Definition of the column range by specifying the first and last column. For last column (col2), the character $ (=end of record) can also be specified.
Example: :1-20: Columns 1 to 20 are selected. An equivalent selection would be to specify the first column as :1:, and a length of 20 (:1:20).
B[S] The specified column range contains a binary number, with (BS), or without (B) the sign. The length of the column range may only be 1, 2, 3 or 4.
C Display the column in character format (Standard).
H This option specifies whether or not the column is to be displayed in hexadecimal format. H sets one of the column-specific hexadecimal modes (see Display command H/NH). X can be specified instead of H.
P[n] The specified column range contains a packed binary number, with or without sign.
n Number of places before the comma. Standard: n = 0
Example: :35-38:P2 provides the following format: 99999,50
Z The specified column range contains a signed decimal number. This definition corresponds to the COBOL "PIC S9" format, and is stored in the following hex form: FaFb ... FnZm. Here, a, b, ... ,n, m represent digits 0, ..., 9. Z represents the sign: the hex values A, C, E, F correspond to positive values, and B, D to negative values.
Example: F1C2 equals +12, F1D2 equals -12
STCK The date and time will be stored in the specified column range as a binary value in STCK (Store Clock) format. The STCK field can be four or eight bytes long. The contents of the field will be displayed as YYYY-MM-DD HH:MM:SS: MMMMMM . MMMMMM corresponds to the millisecond and microsecond values of the time value.
Standard: The column is displayed in its original format (character).
const Constant which will be inserted in each record displayed before the next column, or after the last selected column.
[len] C'string' | X'string'
len
Total constant length. The constant specified in the form C'...'/X'...' will be repeated until the specified length is reached.
Standard: len = Length of the specified string.
C'string' | X'string'
Value of the constant to be inserted. C'string' can be abbreviated to 'string'.
seq Sequential numbering. For SAM and PAM files, a sequential numbering field will be inserted into the display.
Correct numbering for ISAM files can only be guaranteed if a write or search/rewrite command is performed on the file at the outset.
SEQ(len [, step])
len
Length of the numbering field. 1 <= len <= 10.
step
Numbering increment. 1 <= step <= 30000.
Standard: 1
"text" The text entered here defines a column heading which will appear in the Scale line of the display.
As many column/constant ranges can be specified as required. The individual ranges are separated from one another by commas. The selected columns/ constants will be displayed without gaps. Columns can also be duplicated or replaced with the AD command.
FC= Fill Character. Column ranges that lie partially or totally outside of a record are padded with this character. Exception: the last column area will not be padded. It will be restricted to the length of the available data. See the notes below for further details.
Standard: FC=C' '.
NAD Reset AD mode. The records are displayed in their original form.
Standard: NAD
AD The previously defined column selection created by an AD command is reactivated.
AD? | AD?,%name The column selection defined with the last AD command, or the column selection saved with the last SP command %name to a parameter set, is displayed. The description of SP %name is described below.
AD ( ) Entering () will display a special mask. The user is presented with 18 lines within which any number of column definitions may be entered. This should be entered without any gaps, i.e. without blanks.
Pressing the DUE1 (ENTER) key will activate the AD mode. The K1 key will terminate the AD command. The F3 key will produce a hard copy of the mask to a file created by CFS. Otherwise F3 has the same effect as DUE1.
BS2000 commands, as well as the SP command can be entered in the command field of the mask.
Save Parameters. The column definitions defined in the mask are saved to a file with the name CFS. JRSAVE [.jobname], or to a file /FILE file,LINK=JRSAVE. The exact rules by which the names of the JRSAVE files are created are described in Chapter 27 "Files created by CFS", under CFS.JRSAVE.
%name one to 44 character alphanumeric name for the parameter set.
jrsave Name of the JRSAVE file. This file name should only be specified if the parameter was saved to a file named differently from the standard JRSAVE file convention used by CFS (see above).
The user can activate or display a column definition saved with the SP command with the AD %name or AD?,%name commands.
AD %name | %?
The column definition saved earlier with the SP %name command to a parameter set is reactivated.
%?: All relevant parameter sets will be displayed in a list, from which one may be selected by marking it.
AD (file) The column definition is saved in a sequential file, file.
Format of the AD parameter file file:
Each record displays one or more column definitions. The individual definitions should be separated by commas. No comma may appear at the end of the record. The maximum record length of 250 bytes must not be exceeded.
Examples:
AD :21:30
Only 30 bytes from column 21 of each record of the file is displayed. For shorter records, the column display will be reduced accordingly.
AD :21-40:"<-- SPALTE 21-40 -->",:1:20"<-- SPALTE 1-20 --->",4X'FF'
The display will begin with columns 21 to 40. This will also be displayed in the Scale Line ("..."). If any records are shorter than 50 bytes, then the missing area will be padded with blanks (C' ') in the display. With the second parameter defined in the AD command, columns 1 to 20 of each record are selected. The third parameter will cause the records to be blocked off in the display with a constant, X'FFFFFFFF' .
AD (SLCT)
The column ranges stored in the file SLCT are selected from the Display file, and displayed on the screen.
The SLCT file contains the following:
:35-38:"TSN",' '
:45:8"PROGRAM ",' '
:30:10"ISAM KEY",' '
........
:100-$:"REST-REC"
A blank follows the 35 to 38 range. Then columns 45 to 52, a blank, and so on. The selected data will be headed by the respective descriptive text in the Scale Line.
Notes:
If another AD command is issued for a file already displayed in AD mode, then it should be noted that the column values for this new command must relate to the original format of the records, and not to the display already created by the AD command.
The AD mode is only valid for the file actually being displayed. When changing to another file with the NF (Next File) command, the AD mode is switched off. By issuing the AD command without operands, the last column definition can be activated at any time.
When entering a column range in the form :col1-col2:, the '$' character can be specified for col2. $ here stands for the last column of the record. For example, :101-$: will select the range from column 101 to the end of the record. A column definition of the type :col1-$: can only be given as the last definition.
If a column range defined with :col1-col2: or :col1:len is longer than a particular record, then the following two cases should be noted:
a) The specified column range is not the last range.
The missing positions in the record are padded with a specified fill character (Standard: C' ').
b) The specified column range is the last range.
The column range is only displayed to the length of the available data.
Using the AD command, columns may also be multiply displayed. The length of the displayed data can therefore grow by a multiple of the original record length. It should be noted, however, that the maximum of 32,700 positions must not be exceeded.
If the Display file is an ISAM file, the ISAM key should be contained in a column range. The ISAM key must be complete, and in one piece.
Data selected with the AD command and displayed on screen is handled by CFS identically to any other file records. All Display commands such as DS/DW/HEX/R/L/ C, as well as M (Modify) and S (Search) are allowed. The W (Write) command will write the records as displayed to another file. With ISAM files, the currently valid position of the ISAM key (see above), as displayed will be adopted.
If a column is selected multiply, and then amended im Modify mode, then it should be noted that the amendments must be made in the last (that is, the furtherest right) column for the file to be written back correctly.
A combination of the AD and W commands can be used to create a file in which two column ranges are transposed, compared to the original. The columns 21-30 and 41-50 are transposed using the AD command below. Using the Write command, the resulting file is written to the file CFS.SWAP.
AD :1-20:,:41-50:,:31-40:,:21-30:,:51-$:
W9999,CFS.SWAP
If the original file was an ISAM file with KEYPOS=25, KEYLEN=8 and RECFORM=V, then CFS.SWAP will also be created as an ISAM file with KEYPOS=45, KEYLEN=8. Shifting the ISAM key when creating a new file with the Write command is taken care of by CFS.
It is possible to mix hexadecimal and character formats in the same display by using the H option when definging the column. If a column range is specified as hexadecimal with an H or X option, then the data of this column may also be modified in hexadecimal. Other columns, defined without the H option, may be modified in the same step in character mode.