# LIST Command

**URL:** <https://techcommunity.softwareag.com/t/list-command/90904>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [August 6, 2009, 9:13pm UTC](https://techcommunity.softwareag.com/t/list-command/90904 "2009-08-06T21:13:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlos\_Siqueira](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/carlos_siqueira/32/112_2.png) [@Carlos\_Siqueira](https://techcommunity.softwareag.com/u/Carlos_Siqueira)\
**Post date:** [August 6, 2009, 9:13pm UTC](https://techcommunity.softwareag.com/t/list-command/90904/1 "2009-08-06T21:13:24Z")

</div>

I have seen in the past and can’t remember how to LIST a module and include the copycodes as well… :?:

Basically I have a PGM with INCLUDE statement and I would like to see the list as:

PGM:

IF #MONTH = ‘JAN’  
INCLUDE MONCODE  
\*\* SOURCE CODE OF COPYCODE MONCODE WOULD COME NEXT  
MOVE #MONTH TO +MONTH  
WRITE +MONTH  
\*\* END OF COPCODE  
ELSE  
IF #MONTH = ‘FEB’  
…

Am I dreaming???

---

<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:** [August 6, 2009, 9:30pm UTC](https://techcommunity.softwareag.com/t/list-command/90904/2 "2009-08-06T21:30:02Z")

</div>

Hi Carlos;

LIST…FORMATTED

the objects must be STOW’ed to appear in the expanded listing

steve

---

<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:** [August 6, 2009, 10:00pm UTC](https://techcommunity.softwareag.com/t/list-command/90904/3 "2009-08-06T22:00:43Z")

</div>

FORMATTED is for maps and data areas.

By default, all external objects will be expanded with

```auto
L module EXPAND
```

Limit the expansion to copycode with

```auto
L module EXPAND C *
```

---

<div class="post-metadata">

**Author:** ![Carlos\_Siqueira](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/carlos_siqueira/32/112_2.png) [@Carlos\_Siqueira](https://techcommunity.softwareag.com/u/Carlos_Siqueira)\
**Post date:** [August 6, 2009, 10:54pm UTC](https://techcommunity.softwareag.com/t/list-command/90904/4 "2009-08-06T22:54:52Z")

</div>

Thanks Steve & Ralph.

Ralph nailed.

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [August 7, 2009, 2:42pm UTC](https://techcommunity.softwareag.com/t/list-command/90904/5 "2009-08-07T14:42:23Z")

</div>

> [@Ralph Zbrog](#):
>
> By default, all external objects will be expanded with
> 
> ```auto
> L module EXPAND
> ```

Very interesting feature. But I think it works on mainframe only… not on Linux/Solaris ☹

---

<div class="post-metadata">

**Author:** ![Dan\_Eilam](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@Dan\_Eilam](https://techcommunity.softwareag.com/u/Dan_Eilam)\
**Post date:** [February 3, 2015, 7:36am UTC](https://techcommunity.softwareag.com/t/list-command/90904/6 "2015-02-03T07:36:27Z")

</div>

I have a COPYCODE which contains an INCLUDE statement of another COPYCODE. When I submit a batch job to print the program using a command like: LIST program WITH DIR EXPAND C \* lib I am not getting the contents of the second COPYCODE. Is there a way to do it? or that’s the way it works - it only print the first COPYCODE level.  
Thanks

---

<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:** [February 3, 2015, 7:48am UTC](https://techcommunity.softwareag.com/t/list-command/90904/7 "2015-02-03T07:48:20Z")

</div>

I don’t recall EXPAND going more than one level deep, nor do I remember anything about this in the version 8 release notes.

---

<div class="post-metadata">

**Author:** ![Dan\_Eilam](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@Dan\_Eilam](https://techcommunity.softwareag.com/u/Dan_Eilam)\
**Post date:** [February 3, 2015, 9:10am UTC](https://techcommunity.softwareag.com/t/list-command/90904/8 "2015-02-03T09:10:04Z")

</div>

So, the answer to my question is: NO. I didn’t see any limitations on the number of COPYCODE levels, but there is no way to print a second level COPYCODE within it’s calling program.

---

<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, 2:57pm UTC](https://techcommunity.softwareag.com/t/list-command/90904/9 "2021-04-02T14:57:21Z")

</div>


