z/OS ISPF Dialog Tag Language Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Field prompts

z/OS ISPF Dialog Tag Language Guide and Reference
SC19-3620-00

A field prompt is static, descriptive text that explains the field it is associated with. Data fields and selection fields support the use of field prompts. To define a field prompt for a data field or selection field, specify the prompt text as the tag text on the DTAFLD and SELFLD tags.

The PMTLOC attribute defines the location of the prompt using one of these values:
PMTLOC = ABOVE
The prompt appears above and left-aligned with the field. This is the default for selection fields.
PMTLOC = BEFORE
The prompt appears directly in front of and on the same line as the field. This is the default for data fields.

You should define the amount of space the prompt uses by specifying the PMTWIDTH attribute on the DTAFLD and SELFLD tags. If the prompt text is longer than the width you specify on PMTWIDTH, the prompt is word-wrapped on multiple lines. Using the PMTWIDTH attribute can ensure that multiple fields with prompts are aligned evenly. If you do not specify PMTWIDTH, the field prompt length is determined by the length of the prompt text.

When PMTLOC=BEFORE, the conversion utility inserts leader dots at the end of the prompt text to fill the specified prompt width. For output-only data fields, a colon is used in place of the last leader dot. For fields with this prompt location, it is a good idea to specify a PMTWIDTH with a value that allows for leader dots after the prompt text. This lends consistency to the panel appearance. The conversion utility issues a warning message when there is insufficient space for leader dots.

Figure 1 shows how prompts appear.

Figure 1. Prompt locations
                             Application Name

 Name . . . . ____________________
 Address  . . ____________________
 City . . . . ____________________
 State  . . . __

                                       Method of payment
 Age  . . . . __  1.  0  - 12          __  1.  Cash
                  2.  13 - 19              2.  Check
                  3.  20 - 29              3.  Credit card
                  4.  30 - 49
                  5.  50 - 64
                  6.  over 65

 Payment
 ___________




 

The Name, Address, City, and State data fields show the prompts in front of the fields (PMTLOC=BEFORE), as does the Age field, which shows a prompt for a selection field. The same prompt width is used on the first five fields so that they align evenly. The Method of payment and Payment fields demonstrate having the prompt above the field (PMTLOC=ABOVE).

Here is the markup used to demonstrate the field prompts in Figure 1:
<!doctype dm system>

<varclass name=sampcls type ='char 20'>
<varclass name=statcls type='char 2'>
<varclass name=numcls  type='numeric 8 2'>
<varclass name=char1   type='char 1'>

<varlist>
  <vardcl name=name varclass=sampcls>
  <vardcl name=addr varclass=sampcls>
  <vardcl name=city varclass=sampcls>
  <vardcl name=stat varclass=statcls>
  <vardcl name=pay varclass=numcls>
  <vardcl name=age varclass=char1>
  <vardcl name=paymeth varclass=char1>
</varlist>

<panel name=pmt01>Application Name
  <area>
    <dtafld datavar=name entwidth=20 pmtwidth=12>Name
    <dtafld datavar=addr entwidth=20 pmtwidth=12>Address
    <dtafld datavar=city entwidth=20 pmtwidth=12>City
    <dtafld datavar=stat entwidth=2 pmtwidth=12>State
    <divider>
      <region dir=horiz>
        <selfld name=age selwidth=20 pmtloc=before pmtwidth=12>Age
          <choice>0  - 12
          <choice>13 - 19
          <choice>20 - 29
          <choice>30 - 49
          <choice>50 - 64
          <choice>over 65
        </selfld>
        <divider gutter=5>
        <selfld name=paymeth selwidth=24 pmtwidth=20>Method of payment
          <choice>Cash
          <choice>Check
          <choice>Credit card
        </selfld>
      </region>
    <divider>
    <dtafld datavar=pay entwidth=11 pmtloc=above pmtwidth=7>Payment
  </area>
</panel>

Figure 2 shows how the prompt width can affect the appearance of the prompt text.

Figure 2. Prompt widths
                             Application Name

 This is a very, very long prompt __________

 This is a
 very, very
 long prompt  __________

 Here is another long prompt used to show word-wrapping of prompts
 __  1.  Choice 1
     2.  Choice 2

 Here is
 another long
 prompt used to
 show
 word-wrapping
 of prompts
 __  1.  Choice 1
     2.  Choice 2

 

The prompts in the two data fields are formatted differently. The prompt text of the first data field is not wrapped. It formats on one line, using as much space as necessary (up to the maximum available formatting width). The second data field has the same prompt text, with a prompt width that is less than the amount of space needed, so the prompt text is wrapped to as many lines as are needed. Similarly, the two selection fields also demonstrate how the prompt text appears based on the prompt width. The prompt text of data fields and selection fields can be displayed differently by omitting or specifying different values for the PMTWIDTH attribute.

Here is the markup that demonstrates the field prompts in Figure 2:
<!doctype dm system>

<varclass name=sampcls type='char 10'>
<varclass name=char1 type='char 1'>

<varlist>
  <vardcl name=samplea varclass=sampcls>
  <vardcl name=sampleb varclass=sampcls>
  <vardcl name=samplec varclass=char1>
  <vardcl name=sampled varclass=char1>
</varlist>

<panel name=pmt02>Application Name
  <area>
    <dtacol entwidth=10 selwidth=76>
    <dtafld datavar=samplea>This is a very, very long prompt
    <divider>
    <dtafld datavar=sampleb pmtwidth=12>This is a very, very long prompt
    <divider>
    <selfld name=samplec>Here is another long prompt used to show
            word-wrapping of prompts
      <choice>Choice 1
      <choice>Choice 2
    </selfld>
    <divider>
    <selfld name=sampled pmtwidth=14>Here is another long prompt used to show
                                     word-wrapping of prompts
      <choice>Choice 1
      <choice>Choice 2
    </selfld>
    </dtacol>
  </area>
</panel>

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014