General
Application areas: | Input/output of files and records; see "Input/output" |
Macro type: | Type S, MF format 3: D/C/S/E/L form; see "S-type macros" |
Macro description
The GCCSN macro allows the user to display the name of the current coded character set (coding table) for input and output of commands or data.
The name of the current coded character set (coding table) depends on the input or output source:
SYSDTA/SYSCMD/SYSOUT is assigned to a data display terminal:
The CCS name is determined by VTSU. The GCCSN macro receives the name (internally) from the ACTCH field of the TSTAT macro's parameter list.SYSDTA/SYSCMD/SYSOUT/SYSLST is assigned to an S variable:
Interactive mode: the same as when SYSDTA/SYSCMD is assigned to a data display terminal.
Batch mode: the CCS name 'EDF03IRV' is displayed.SYSDTA/SYSCMD/SYSOUT/SYSLST is assigned to a PLAM library element:The CCS name of the library element is displayed.
If no coding table is assigned to the library element, the coding table name “EDF03IRV” is displayed.SYSCMD is assigned to a file:
The CCS name in the catalog entry for the file is displayed. Files may be cataloged files, S procedures and non-S procedures.SYSDTA/SYSOUT/SYSLST is assigned to a file:
The CCS name in the catalog entry for the file is displayed. Files may be cataloged files, S procedures and non-S procedures (if SYSDTA=(SYSCMD)).
The name of the coding table for SYSOUT/SYSLST can be assigned using the commands/ASSIGN-SYSOUT/SYSLST CODED-CHARACTER-SET=
.
If no coding table is assigned, the default name of the user catalog entry is displayed.
Once the parameter list has been initialized (MF=L) the function call (MF=E) is issued. If the macro is executed without errors, the field <PREFIX><MACID>CCSN
in the parameter list contains the CCS name of the queried system file.
Macro format and description of operands
GCCSN |
STREAM=SYSDTA / SYSCMD / SYSOUT / SYSLST ,MF=D / C / S / E / L [,PARAM=addr / (r)] ,PREFIX=C / p ,MACID=CSN / macid |
MF=
For a general description of the MF operand, its operand values and any subsequent operands (e.g. PREFIX, MACID and PARAM), see "S-type macros". The valid MF values are given at the start of the macro description under “Macro type” and are included in the macro format.
A PREFIX can be specified in the C form or D form of the macro and additionally a MACID in the C form (see "S-type macros").
It is also possible to call this macro with MF=S.
STREAM=
Specifies the system file whose CCS name is to be output.
SYSDTA
The CCS name of SYSDTA is to be displayed.
SYSCMD
The CCS name of SYSCMD is to be displayed.
SYSOUT
The CCS name of SYSSYSOUT is to be displayed.
SYSLST
The CCS name of SYSLST is to be displayed.
Notes
If SYSDTA is assigned to a data display terminal, the user can modify the CCS name dynamically in a program (in the VTSU control block of the RDATA macro).This modification is valid only during this RDATA input/output and has no effect on the output of the GCCSN macro, which in this case always displays the CCS name that is predefined in the user's user catalog.
If SYSCMD is assigned to a data display terminal, privileged users can modify the CCS name dynamically (in the VTSU control block of the WRTRD macro).
This modification is valid only during this WRTRD input/output and has no effect on the output of the GCCSN macro, which in this case always displays the CCS name that is predefined in the user's user catalog.
If SYSDTA/SYSCMD/SYSOUT/SYSLST is assigned to a file or a library element, the CCS name does not change between the time the file or library element is opened (OPEN) and the time it is closed (CLOSE).
If a procedure is interrupted with K2, the current SYSDTA CCS name is not that of the data display terminal but that of the procedure that has just been interrupted.
If, during processing of a procedure, a procedure parameter is prompted at the data display terminal, the current CCS name for this procedure applies to the fixed (requesting) part of the command/statement line. The CCS name of the data display terminal applies to the parameter value entered.
Example
Level 1: data display terminal Level 2: procedure HALLO : (IN) /CALL-PROC HALLO -----> /BEGIN-PROC A,PROC-PAR=(&PARAM),/ ESC-CHAR='&' /ASS-SYSDTA *SYSCMD /START-PROG $EDT <---------------------------- @READ'&PARAM (OUT) &PARAM= (IN) TEST.1 ----------------------------> @READ'TEST.1 :
The string
@READ'
is read using the CCS name for the HALLO procedure; the stringTEST.1
is read using the CCS name for the data display terminal.The user can issue the RDATA ..,A macro to obtain information on any modifications to the SYSDTA assignment.
Layout of the CSECT
GCCSN MF=C 1 #INTF REFTYPE=REQUEST,INTNAME=GCCSN,INTCOMP=002 1 MFCHK MF=C,SUPPORT=(C,D,S,L,E),PREFIX=C, C 1 MACID=CSN,DMACID=CSN, C 1 PARAM=,ALIGN=F,SVC=39 2 DS 0F 2 *,##### PREFIX=C, MACID=CSN ##### 1 CCSNCS FHDR MF=(C,CCSN) 2 CCSNCS DS 0A 2 CCSNFHE DS 0XL8 0 GENERAL PARAMETER AREA HEADER 2 * 2 CCSNIFID DS 0A 0 INTERFACE IDENTIFIER 2 CCSNFCTU DS AL2 0 FUNCTION UNIT NUMBER 2 * BIT 15 HEADER FLAG BIT, 2 * MUST BE RESET UNTIL FURTHER NOTICE 2 * BIT 14-12 UNUSED, MUST BE RESET 2 * BIT 11-0 REAL FUNCTION UNIT NUMBER 2 CCSNFCT DS AL1 2 FUNCTION NUMBER 2 CCSNFCTV DS AL1 3 FUNCTION INTERFACE VERSION NUMBER 2 * 2 CCSNRET DS 0A 4 GENERAL RETURN CODE 2 * 2 * GENERAL_RETURN_CODE CLEARED (X'00000000') MEANS 2 * REQUEST SUCCESSFUL PROCESSED AND NO ADDITIONAL INFORMATION 2 * 2 CCSNSRET DS 0AL2 4 SUB RETURN CODE 2 CCSNSR2 DS AL1 4 SUB RETURN CODE 2 2 * ALWAYS CLEARED (X'00') IF MAIN_RETURN_CODE IS X'FFFF' 2 * Standard subcode2 values as defined by convention: 2 CCSNR2OK EQU X'00' All correct, no additional info 2 CCSNR2NA EQU X'01' Successful, no action was necessary 2 CCSNR2WA EQU X'02' Warning, particular situation 2 CCSNSR1 DS AL1 5 SUB RETURN CODE 1 2 * 2 * GENERAL INDICATION OF ERROR CLASSES 2 * 2 * CLASS A X'00' FUNCTION WAS SUCCESSFULLY PROCESSED 2 * CLASS B X'01' - X'1F' PARAMETER SYNTAX ERROR 2 * CLASS C X'20' INTERNAL ERROR IN CALLED FUNCTION 2 * CLASS D X'40' - X'7F' NO CLASS SPECIFIC REACTION POSSIBLE 2 * CLASS E X'80' - X'82' WAIT AND RETRY 2 * 2 CCSNRFSP EQU X'00' FUNCTION SUCCESSFULLY PROCESSED 2 CCSNRPER EQU X'01' PARAMETER SYNTAX ERROR 2 * 3 GLOBALLY DEFINED ISL ERROR CODES IN CLASS X'01' - X'1F' 2 CCSNRFNS EQU X'01' CALLED FUNCTION NOT SUPPORTED
2 CCSNRFNA EQU X'02' CALLED FUNCTION NOT AVAILABLE 2 CCSNRVNA EQU X'03' INTERFACE VERSION NOT SUPPORTED 2 * 2 CCSNRAER EQU X'04' ALIGNMENT ERROR 2 CCSNRIER EQU X'20' INTERNAL ERROR 2 CCSNRCAR EQU X'40' CORRECT AND RETRY 2 * 2 GLOBALLY DEFINED ISL ERROR CODES IN CLASS X'40' - X'7F' 2 CCSNRECR EQU X'41' SUBSYSTEM (SS) MUST BE CREATED 2 * EXPLICITELY BY CREATE-SS 2 CCSNRECN EQU X'42' SS MUST BE EXPLICITELY CONNECTED 2 * 2 CCSNRWAR EQU X'80' WAIT FOR A SHORT TIME AND RETRY 2 CCSNRWLR EQU X'81' " LONG " 2 CCSNRWUR EQU X'82' WAIT TIME IS UNCALCULABLY LONG 2 * BUT RETRY IS POSSIBLE 2 * 2 GLOBALLY DEFINED ISL ERROR CODES IN CLASS X'80' - X'82' 2 CCSNRTNA EQU X'81' SS TEMPORARILY NOT AVAILABLE 2 CCSNRDH EQU X'82' SS IN DELETE / HOLD 2 * 2 CCSNMRET DS 0AL2 6 MAIN RETURN CODE 2 CCSNMR2 DS AL1 6 MAIN RETURN CODE 2 2 CCSNMR1 DS AL1 7 MAIN RETURN CODE 1 2 * 2 * SPECIAL LAYOUT OF LINKAGE_MAIN_RETURN_CODE (YYYY IN X'00XXYYYY') 2 * 2 CCSNRLNK EQU X'FFFF' LINKAGE ERROR / REQ. NOT PROCESSED 2 CCSNFHL EQU 8 8 GENERAL OPERAND LIST HEADER LENGTH 2 * 1 CCSNFLAG DS X STREAM IDENTIFIER 1 CCSNDTA EQU X'01' SYSDTA 1 CCSNCMD EQU X'02' SYSCMD 1 CCSNOUT EQU X'03' SYSOUT 1 CCSNLST EQU X'04' SYSLST 1 CCSNRES1 DS CL3 RESERVED 1 CCSNRES2 DS A RESERVED 1 CCSNRES3 DS A RESERVED 1 CCSNCCSN DS CL8 CODED CHARACTER SET NAME 1 CCSNPAR EQU X'01' SC1 RC : PARAMETER ERROR 1 CCSNERR EQU X'20' SC1 RC : INTERNAL ERROR 1 CCSN# EQU *-CCSNCS PARAMETER LIST LENGTH 1 SPACE 2
Return information and error flags
During macro processing, register R1 receives the parameter list address. The CCS name is transferred in the field <PREFIX><MACID>CCSN
in the parameter list.
Standard header:
+---------------+ | | | | | |0|0|b|b|a|a|a|a| +---------------+
A structured return code relating to the execution of the GCCSN macro is transferred (bb=Subcode1, aaaa=Maincode):
X'bb' | X'aaaa' | Meaning |
X'00' | X'0000' | Normal execution. |
X'01' | X'0008' | Operand error. |
X'20' | X'0004' | Internal error. |
Other return codes which, in accordance with conventions, apply to all macros are given in the table “Standard return codes” (Standard header).