# How to eliminate blank lines in a DISPLAY statement group header

**URL:** <https://techcommunity.softwareag.com/t/how-to-eliminate-blank-lines-in-a-display-statement-group-header/196639>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-News-and-General-Topics\
**Created:** [September 27, 2017, 8:22pm UTC](https://techcommunity.softwareag.com/t/how-to-eliminate-blank-lines-in-a-display-statement-group-header/196639 "2017-09-27T20:22:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lars\_Bergeson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/lars_bergeson/32/1271_2.png) [@Lars\_Bergeson](https://techcommunity.softwareag.com/u/Lars_Bergeson)\
**Post date:** [September 27, 2017, 8:22pm UTC](https://techcommunity.softwareag.com/t/how-to-eliminate-blank-lines-in-a-display-statement-group-header/196639/1 "2017-09-27T20:22:49Z")

</div>

How do I eliminate the blank lines in a DISPLAY statement when using a group header? For example:

```auto

DEFINE DATA LOCAL
1 #DATA (A10/1:2) INIT <'ABC12','DEF34'>
1 #GROUP (HD='GRP')
  2 #SUB-FIELD1 (A1) (HD='SF1')
  2 #SUB-FIELD2 (A1) (HD='SF2')
  2 #SUB-FIELD3 (A1) (HD='SF3')
1 #FIELD1 (A1) (HD='//F1')
1 #FIELD2 (A1) (HD='//F2')
1 #X (I4)
END-DEFINE
FOR #X = 1 TO 2
  MOVE SUBSTR(#DATA(#X),1,1) TO #GROUP.#SUB-FIELD1
  MOVE SUBSTR(#DATA(#X),2,1) TO #GROUP.#SUB-FIELD2
  MOVE SUBSTR(#DATA(#X),3,1) TO #GROUP.#SUB-FIELD3
  MOVE SUBSTR(#DATA(#X),4,1) TO #FIELD1
  MOVE SUBSTR(#DATA(#X),5,1) TO #FIELD2
  DISPLAY NOTITLE (GC=-) #GROUP #FIELD1 #FIELD2
END-FOR
END
```

Produces the following output:

```
----GRP----

SF1 SF2 SF3 F1 F2
--- --- --- -- --

A B C 1 2
D E F 3 4
```

1) How do I get rid of the blank line after ----GRP----?  
2) Is there a way to get rid of the blank line that appears before the first row of data? (I think this blank line appears regardless of whether or not a group header is being used)  
Also, is there a way to use a fixed-width font when posting questions in this forum? The HTML

```
tag doesn’t seem to work.
```

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [September 27, 2017, 10:23pm UTC](https://techcommunity.softwareag.com/t/how-to-eliminate-blank-lines-in-a-display-statement-group-header/196639/2 "2017-09-27T22:23:50Z")

</div>

Don’t like to give bad news, especially on your first posting, but,

1. Not possible
2. No
3. No

The first two may have been suggested on SAG’s Brainstorm site. If so, vote for them.

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [September 28, 2017, 1:19am UTC](https://techcommunity.softwareag.com/t/how-to-eliminate-blank-lines-in-a-display-statement-group-header/196639/3 "2017-09-28T01:19:32Z")

</div>

This text precedes the code snippet.

```auto

   DEFINE SUBROUTINE PREFORMATTED
        PRINT "Use 'Code' button to start and end preformatted (code) text"
   END-SUBROUTINE
```

This text follows code snippet.

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [September 28, 2017, 11:50am UTC](https://techcommunity.softwareag.com/t/how-to-eliminate-blank-lines-in-a-display-statement-group-header/196639/4 "2017-09-28T11:50:48Z")

</div>

Short answers, NO.  
Long answers, yes, if you don’t mind coding the headers yourself. See code and output below

```
DEFINE DATA LOCAL  

```

1 #DATA (A10/1:2) INIT \<‘ABC12’,‘DEF34’\>  
1 #GROUP (HD=‘GRP’)  
2 #SUB-FIELD1 (A1) (HD=‘SF1’)  
2 #SUB-FIELD2 (A1) (HD=‘SF2’)  
2 #SUB-FIELD3 (A1) (HD=‘SF3’)  
1 #FIELD1 (A1) (HD=‘//F1’)  
1 #FIELD2 (A1) (HD=‘//F2’)  
1 #X (I4)  
END-DEFINE  
\*  
 write title left justified ’ grp’ / ‘sf1 sf2 sf3 f1 f2’   
FOR #X = 1 TO 2  
MOVE SUBSTR(#DATA(#X),1,1) TO #GROUP.#SUB-FIELD1  
MOVE SUBSTR(#DATA(#X),2,1) TO #GROUP.#SUB-FIELD2  
MOVE SUBSTR(#DATA(#X),3,1) TO #GROUP.#SUB-FIELD3  
MOVE SUBSTR(#DATA(#X),4,1) TO #FIELD1  
MOVE SUBSTR(#DATA(#X),5,1) TO #FIELD2  
DISPLAY NOTITLE nohdr   
/\* (GC=-)  
#GROUP #FIELD1 #FIELD2  
END-FOR  
END

```
   grp

```

sf1 sf2 sf3 f1 f2  
A B C 1 2  
D E F 3 4

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [September 29, 2017, 2:12am UTC](https://techcommunity.softwareag.com/t/how-to-eliminate-blank-lines-in-a-display-statement-group-header/196639/5 "2017-09-29T02:12:08Z")

</div>

Actually, the answer to your 2nd question is “Yes” …  
A2. You can turn off the Underline Character. DISPLAY (UC=OFF) will “get rid of the blank line which appears before the first row of data”.  
NB. But it will also “get rid of” the underlines below the column headers.  
So the output will look like this:  
----GRP----

SF1 SF2 SF3 F1 F2  
A B C 1 2  
D E F 3 4

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [September 29, 2017, 3:30am UTC](https://techcommunity.softwareag.com/t/how-to-eliminate-blank-lines-in-a-display-statement-group-header/196639/6 "2017-09-29T03:30:00Z")

</div>

Just a quick note on Steve’s excellent solution:

1. the (HD=…) declarations are still required, even though the WRITE TITLE is now defining the “column header” texts
2. the “column header widths” must be the same in the (HD=…) and the WRITE TITLE texts. otherwise your data rows may not line up nicely under the column headers.  
.  
For example, if you comment out the (HD=…) definitions in Steve’s program then the DISPLAY’s column widths will default back to the length of the field names.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:39pm UTC](https://techcommunity.softwareag.com/t/how-to-eliminate-blank-lines-in-a-display-statement-group-header/196639/7 "2021-04-02T15:39:23Z")

</div>


