z/OS ISPF Services Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


VIEW—view a data set

z/OS ISPF Services Guide
SC19-3626-00

The VIEW service enables you to manipulate data without the risk of saving changes. As in the EDIT service, data can be manipulated through the use of familiar line and primary commands.

The VIEW service functions exactly like the EDIT service, with these exceptions:

  • You must use the REPLACE or CREATE primary command to save data. The SAVE primary command is disabled when using the VIEW service.
  • If you are AUTOSAVE mode and enter the END primary command after you have altered the file being viewed, the View Warning pop-up panel gives you the option of exiting with no changes saved (by entering the END command again), or using the CREATE or REPLACE command to save your changes. If you have made no changes to the data set or member being viewed, the VIEW service terminates as it would in EDIT mode.

The VIEW service provides an interface to the VIEW function and bypasses the display of the View Entry Panel. The VIEW interface allows you to use a customized panel for displaying data (use panel ISREFR01 as a model when creating your panel), and lets you specify the initial macro and the edit profile to be used.

You can use VIEW to view any ISPF library, concatenation of ISPF libraries, or data set that can be allocated by using the LMINIT service. You can use the service recursively, either through nested dialogs or by entering a VIEW command while viewing a member or data set. In addition, the EDIT and BROWSE commands can be nested within a VIEW session until you run out of storage.

Note:
  1. Dialogs that invoke the VIEW service may invoke the EDREC service first to start view recovery, because the VIEW service does not do view recovery.
  2. The VIEW service might alter the DISPLAY environment. Do not expect the DISPLAY environment that existed before invoking the VIEW service to remain unchanged.
  3. The VIEW service cannot be issued by a PL/I main program that also uses subtasking.
  4. When you do an EDREC QUERY, ZEDMODE is set to V for View or E for Edit.

When VIEW is operating in recovery mode, a record of your interactions is automatically recorded in a PDF-controlled data set. Following a system failure, you can use the record to recover the data you were viewing.

A dialog using VIEW can place data into the ZEDUSER dialog variable in the shared pool. The data in ZEDUSER is saved in the edit recovery table as an extension variable when the recovery data set is initialized. This is done if RECOVERY is ON when first entering view or after using the CREATE or REPLACE command. The data is then made available in dialog variable ZEDUSER at the time view recovery is processed.

You can use VIEW to display workstation files on the host and host data sets on the workstation. The ZWSWFN variable is the workstation working file name that is generated by ISPF. The variable ZLRECL is the LRECL of the host data set being edited. Both can be used in the workstation VIEW parameters field. ISPF interprets any string that starts with an ampersand (&) as a system variable and evaluates it before passing to the workstation command. Strings that do not start with an ampersand are passed as is.

Batch commands can also be specified in the Workstation Browse/View fields, besides the View program name. If you have a file transferred to the workstation that you wish to do some work on besides View, you can do that in the beginning of the batch file before invoking the editor. Depending on the parameters passed to the batch command, you can also have conditional logic to perform other functions as well.

Command invocation format

Read syntax diagramSkip visual syntax diagram
>>-ISPEXEC--VIEW--DATASET(dsname)--+----------------+----------->
                                   '-VOLUME(serial)-'   

>--+----------------------+--+-------------------+-------------->
   '-PASSWORD(pswd-value)-'  '-PANEL(panel-name)-'   

>--+-------------------+--+-----------------------+------------->
   '-MACRO(macro-name)-'  '-PROFILE(profile-name)-'   

>--+---------------------+--+------------------+---------------->
   '-FORMAT(format-name)-'  |        .-NO--.   |   
                            '-MIXED(-+-YES-+-)-'   

>--+--------------------+--+---------------+-------------------->
   |          .-YES-.   |  |     .-NO--.   |   
   '-CONFIRM(-+-NO--+-)-'  '-WS(-+-YES-+-)-'   

>--+--------------------+--+----------------+--+-------+-------->
   |          .-YES-.   |  '-PARM(parm-var)-'  +-ASCII-+   
   '-CHGWARN(-+-NO--+-)-'                      '-UTF8--'   

>--+-------------------+---------------------------------------><
   '-LINECMDS(tabname)-'   

or

Read syntax diagramSkip visual syntax diagram
>>-ISPEXEC--VIEW--DATAID(data-id)--+---------------------+------>
                                   '-MEMBER(member-name)-'   

>--+-------------------+--+-------------------+----------------->
   '-PANEL(panel-name)-'  '-MACRO(macro-name)-'   

>--+-----------------------+--+---------------------+----------->
   '-PROFILE(profile-name)-'  '-FORMAT(format-name)-'   

>--+------------------+--+--------------------+----------------->
   |        .-NO--.   |  |          .-YES-.   |   
   '-MIXED(-+-YES-+-)-'  '-CONFIRM(-+-NO--+-)-'   

>--+---------------+--+--------------------+-------------------->
   |     .-NO--.   |  |          .-YES-.   |   
   '-WS(-+-YES-+-)-'  '-CHGWARN(-+-NO--+-)-'   

>--+----------------+--+-------+--+-------------------+--------><
   '-PARM(parm-var)-'  +-ASCII-+  '-LINECMDS(tabname)-'   
                       '-UTF8--'                          

or

Read syntax diagramSkip visual syntax diagram
>>-ISPEXEC--VIEW--WSFN(ws-filename)--+-------------------+------>
                                     '-PANEL(panel-name)-'   

>--+-------------------+--+-----------------------+------------->
   '-MACRO(macro-name)-'  '-PROFILE(profile-name)-'   

>--+---------------------+--+------------------+---------------->
   '-FORMAT(format-name)-'  |        .-NO--.   |   
                            '-MIXED(-+-YES-+-)-'   

>--+--------------------+--+---------------+-------------------->
   |          .-YES-.   |  |     .-NO--.   |   
   '-CONFIRM(-+-NO--+-)-'  '-WS(-+-YES-+-)-'   

>--+--------------------+--+----------------+------------------><
   |          .-YES-.   |  '-PARM(parm-var)-'   
   '-CHGWARN(-+-NO--+-)-'                       

or

Read syntax diagramSkip visual syntax diagram
>>-ISPEXEC--VIEW--FILE(file-var)--+-------------------+--------->
                                  '-PANEL(panel-name)-'   

>--+-------------------+--+-----------------------+------------->
   '-MACRO(macro-name)-'  '-PROFILE(profile-name)-'   

>--+---------------------+--+------------------+---------------->
   '-FORMAT(format-name)-'  |        .-NO--.   |   
                            '-MIXED(-+-YES-+-)-'   

>--+--------------------+--+---------------+-------------------->
   |          .-YES-.   |  |     .-NO--.   |   
   '-CONFIRM(-+-NO--+-)-'  '-WS(-+-YES-+-)-'   

>--+--------------------+--+----------------+--+-------+-------->
   |          .-YES-.   |  '-PARM(parm-var)-'  +-ASCII-+   
   '-CHGWARN(-+-NO--+-)-'                      '-UTF8--'   

>--+-------------------+---------------------------------------><
   '-LINECMDS(tabname)-'   

Call invocation format

Read syntax diagramSkip visual syntax diagram
>>-CALL--ISPLINK--('VIEWbbbb'--,--+--------+--,-+-serial-+------>
                                  '-dsname-'    '-'b'----'   

>--,-+-pswd-value-+--,-+-panel-name-+--,-+-macro-name-+--------->
     '-'b'--------'    '-'b'--------'    '-'b'--------'   

>--,-+-profile-name-+--,--+---------+--,-+-member-name-+-------->
     '-'b'----------'     '-data-id-'    '-'b'---------'   

                        .-'NObbbbbb'-.    .-'YESbbbbb'-.      
>--,-+-format-name-+--,-+-'b'--------+--,-+-'b'--------+--,----->
     '-'b'---------'    '-'YESbbbbb'-'    '-'NObbbbbb'-'      

                                  .-'YES'-.                
>--+-------------------------+--,-+-'b'---+--,-+-'b'---+-------->
   '-ws-filename-buffer-name-'    '-'NO'--'    +-'YES'-+   
                                               '-'NO'--'   

>--,-+-parm-var-+--,--+----------+--,-+-'ASCII'-+-);------------>
     '-'b'------'     '-file-var-'    +-'UTF8'--+      
                                      '-'b'-----'      

>--,-+-tabname-+-----------------------------------------------><
     '-'b'-----'   

or

Read syntax diagramSkip visual syntax diagram
>>-CALL--ISPEXEC--(buf-len,--buffer);--------------------------><

Parameters

dsname
The data set name, in TSO syntax, of the data set to be viewed. This is equivalent to the "other" data set name on the View Entry Panel. You can specify a fully qualified data set name enclosed in apostrophes (' '). If the apostrophes are omitted, the TSO data set prefix from the user's TSO profile is automatically attached to the data set name. The maximum length of this parameter is 56 characters.

For ISPF libraries and MVS™ partitioned data sets, you can specify a member name or a pattern enclosed in parentheses. If you do not specify a member name or if you specify a member pattern as part of the dsname specification when the DATASET keyword is used, a member selection list for the ISPF library, concatenation of libraries, or MVS partitioned data set is displayed. For more information about patterns and pattern matching, see the z/OS ISPF User's Guide Vol I.

Note: You can also specify a VSAM data set name. If a VSAM data set is specified, ISPF checks the ISPF configuration table to see if VSAM support is enabled. If it is, the specified tool is invoked. If VSAM support is not enabled, an error message is displayed.
serial
The serial number of the volume on which the data set resides. If you omit this parameter or code it as blank, the system catalog is searched for the data set name. The maximum length of this parameter is 6 characters.
pswd-value
The password if the data set has MVS password protection. Do not specify a password for RACF-protected data sets.
panel-name
The name of a customized view panel, created by you, to be used when displaying the data. See z/OS ISPF Planning and Customizing for information about developing a customized panel.
macro-name
The name of the first edit macro to be executed after the data is read, but before it is displayed. See z/OS ISPF Edit and Edit Macros for more information.
profile-name
The name of the edit profile to be used. If you do not specify a profile name, the profile name defaults to the ISPF library type or last qualifier of the "other" TSO data set name. See z/OS ISPF Edit and Edit Macros for more information.
format-name
The name of the format to be used to reformat the data. The format-name parameter is provided to support the IBM® 5550 terminal using the Double-Byte Character Set (DBCS).
YES|NO
For the MIXED parameter, if YES is specified, the VIEW service treats the data as mixed-mode DBCS data. If NO is specified, the data is treated as EBCDIC (single-byte) data. This parameter is provided to support the IBM 5550 terminal using the Double-Byte Character Set (DBCS).
YES|NO
For the CONFIRM parameter, if you specify YES and then attempt to CANCEL, MOVE, or REPLACE data while in VIEW mode, ISPF displays a pop-up panel that requires you to confirm the action. Because members or data sets that are canceled, moved, or replaced are deleted, CONFIRM acts as a safeguard against accidental data loss. If you want to terminate the view session without saving the data, press ENTER. If you made a mistake and want to return to the view session, enter the END command. If you specify NO as the CONFIRM value, you will not be required to confirm a CANCEL, MOVE, or REPLACE.
YES|NO
For the WS keyword, if you specify YES the VIEW service enables you to view the host data set or workstation file on the workstation using the workstation tool configured in the ISPF tool integrator. For more information, see the information about Workstation Tool Integration in the Settings (Option 0) topic of the z/OS ISPF User's Guide Vol II. If you specify NO as the WS value, the VIEW service views the host data set or workstation file on the host.
YES|NO
For the CHGWARN keyword, if you specify YES the VIEW service gives a warning when the first data change is made, indicating that data cannot be saved in View. If you specify NO, no data change warning is given.
data-id
The data ID that was returned from the LMINIT service. The maximum length of this parameter is 8 characters.
You can use the LMINIT service in either of two ways before invoking the VIEW service:
  • You can use LMINIT to allocate existing data sets by specifying a data set name or ISPF library qualifiers. LMINIT returns a data ID as output. This data ID, rather than a data set name, is then passed as input to the VIEW service.
  • The dialog can allocate its own data sets by using the TSO ALLOCATE command or MVS dynamic allocation, and then passing the ddname to LMINIT. Again, a data ID is returned as output from LMINIT and subsequently passed to the VIEW service. This procedure is called the ddname interface to VIEW. It is particularly useful for viewing VIO data sets, which cannot be accessed by data set name because they are not cataloged.
member-name
A member of an ISPF library or MVS partitioned data set, or a pattern. If you do not specify a member name when the MEMBER keyword or call invocation is used, or if a pattern is specified, a member selection list for the ISPF library, concatenation of libraries, or MVS partitioned data set is displayed. For more information about patterns and pattern matching, see the z/OS ISPF User's Guide Vol I.
ws-filename-buffer-name
Specifies the name of a variable containing the path and the file name (in the syntax of the workstation's operating system) of the workstation file to be edited. The maximum length of the path and the workstation file name within this variable is 256. If the path is omitted, the working directory configured in the ISPF tool integrator will be inserted in front of the workstation file name to resolve the relative path. See the information about Workstation Tool Integration in the Settings (Option 0) topic of the z/OS ISPF User's Guide Vol II.
ASCII|UTF8
This parameter can be specified when invoking VIEW to view data encoded in ASCII (or UTF-8) and the file is not tagged with a CCSID of 819 (or 1208).

When ASCII is specified or the file is tagged with CCSID 819, the editor renders the ASCII data readable by converting it to the CCSID of the terminal. Also, if set for a z/OS® UNIX file, the editor breaks up the data into records using the ASCII linefeed character (X'0A') and the ASCII carriage return character (X'0D') as the record delimiter. For z/OS UNIX files, the linefeed and carriage return characters are removed from the data loaded into the editor but written back to the file when the data is saved. This option should not be used when viewing workstation files which are converted to EBCDIC when they are loaded from the workstation.

When UTF8 is specified, or the file is tagged with CCSID 1208, the equivalent actions happen, except for UTF-8 instead of ASCII.

tabname
The name of a user line command table to be provided by the service caller.
buf-len
A fullword fixed binary integer containing the length of the buffer parameter.
buffer
A buffer containing the name of the service and its parameters in the same form as they would appear in an ISPEXEC invocation for a command invocation.
parm-var
The name of an ISPF variable that contains parameters which are to be passed to the initial macro specified by macro-name. The variable value must not exceed 200 bytes in length. If no macro name is specified, parm-var must be blank or not specified.
file-var
The name of an ISPF variable containing the path name for a z/OS UNIX regular file or directory. If the path name is for a directory, a directory selection list is displayed.

Return codes

These return codes are possible:
 0
Normal completion. Browse was substituted for VIEW if insufficient storage was available to read in the requested data.
Note: Data can only be saved through the CREATE or REPLACE primary commands.
12
VIEW has been disabled through the ISPF configuration table.
14
Member, sequential data set, or z/OS UNIX file in use.
16
Either:
  • No members matched the specified pattern
  • No members in the partitioned data set.
18
A VSAM data set was specified but the ISPF Configuration Table does not allow VSAM processing.
20
Severe error; unable to continue.

Examples

Example 1:

This example invokes the VIEW service for TELOUT, a member of the ISPFPROJ.FTOUTPUT data set, using the viewer command configured on the workstation.

Command invocation

ISPEXEC VIEW DATASET('ISPFPROJ.FTOUTPUT(TELOUT)') WS(YES)

OR

ISPEXEC LMINIT DATAID(EDT) DATASET('ISPFPROJ.FTOUTPUT')
ISPEXEC VIEW DATAID(&EDT) MEMBER(TELOUT) WS(YES)

Call invocation

CALL ISPLINK ('VIEW','ISPFPROJ.FTOUTPUT(TELOUT)',' ',' ',' ',' ',' ',' ',
    ' ',' ',' ',' ',' ',' ','YES');

OR
 
Set the program variable BUFFER to contain:
BUFFER = 'VIEW DATASET('ISPFPROJ.FTOUTPUT(TELOUT)'') WS(YES)';
Set the program variable BUFFLN to the length of the variable BUFFER. Issue the command:
CALL ISPEXEC (BUFFLN, BUFFER);

Example 2:

This example invokes the VIEW service for a workstation file, c:\config.sys, using the ISPF editor on the host.

Command invocation

Set the command variable WSFNNAME to contain:

WSFNNAME='c:\config.sys'

ISPEXEC VIEW WSFN(WSFNNAME) WS(NO)

Call invocation

Set the program variable to contain:
WSFNNAME='c:\config.sys';

CALL ISPLINK('VIEW',' ',' ',' ',' ',' ',' ',
    ' ',' ',' ',' ',' ',' ',' WFSNNAME','NO');

OR
Set the program variable WSFNNAME to contain:
WSFNNAME='c:\config.sys';
Set the program variable BUFFER to contain:
BUFFER='VIEW WSFN(WSFNNAME) WS(NO)';
Set the program variable BUFFLEN to the length of the variable BUFFER. Enter the command:
CALL ISPEXEC(BUFFLEN,BUFFER);

Example 3:

This example invokes the VIEW service for z/OS UNIX file /u/user1/filea.

Command invocation

FILEVAR='/u/user1/filea'
ISPEXEC VIEW FILE(FILEVAR)

Call invocation

FILEVAR='/u/user1/filea';
CALL ISPLINK('VIEW',' ',' ',' ',' ',' ',' ',
    ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','FILEVAR ');

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014