# Copy Natural program to a dataset?

**URL:** <https://techcommunity.softwareag.com/t/copy-natural-program-to-a-dataset/173792>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes, Natural-on-Windows-Unix\
**Created:** [December 27, 2013, 9:24pm UTC](https://techcommunity.softwareag.com/t/copy-natural-program-to-a-dataset/173792 "2013-12-27T21:24:23Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bharanidharan\_Vayalur\_Radhakrishnan](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@Bharanidharan\_Vayalur\_Radhakrishnan](https://techcommunity.softwareag.com/u/Bharanidharan_Vayalur_Radhakrishnan)\
**Post date:** [December 27, 2013, 9:24pm UTC](https://techcommunity.softwareag.com/t/copy-natural-program-to-a-dataset/173792/1 "2013-12-27T21:24:23Z")

</div>

Is it possible to copy a natural program on to a dataset?

Thanks,  
Bharani

---

<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:** [December 28, 2013, 12:10pm UTC](https://techcommunity.softwareag.com/t/copy-natural-program-to-a-dataset/173792/2 "2013-12-28T12:10:29Z")

</div>

What is it you are trying to do that would require such a dataset?

---

<div class="post-metadata">

**Author:** ![Bharanidharan\_Vayalur\_Radhakrishnan](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@Bharanidharan\_Vayalur\_Radhakrishnan](https://techcommunity.softwareag.com/u/Bharanidharan_Vayalur_Radhakrishnan)\
**Post date:** [December 28, 2013, 7:54pm UTC](https://techcommunity.softwareag.com/t/copy-natural-program-to-a-dataset/173792/3 "2013-12-28T19:54:30Z")

</div>

I have a few thousand programs in a library in production. I need to run various scans on a few tens of programs every now and then for some analysis. I find it hard to work with such a huge library.  
I thought if I could get all the source on to a PDS as members, then I can work with a subset of them them more easily.

---

<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:** [December 29, 2013, 12:18pm UTC](https://techcommunity.softwareag.com/t/copy-natural-program-to-a-dataset/173792/4 "2013-12-29T12:18:05Z")

</div>

Do you have Entire (Natural) Connection?

This would make it easy to move selected program objects to a PC where you could employ any edit tools available to you.

---

<div class="post-metadata">

**Author:** ![Bharanidharan\_Vayalur\_Radhakrishnan](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@Bharanidharan\_Vayalur\_Radhakrishnan](https://techcommunity.softwareag.com/u/Bharanidharan_Vayalur_Radhakrishnan)\
**Post date:** [December 30, 2013, 5:44am UTC](https://techcommunity.softwareag.com/t/copy-natural-program-to-a-dataset/173792/5 "2013-12-30T05:44:04Z")

</div>

thanks Steve. I don’t have entire connection. I will try asking our Configuration Management folks if they can copy over the selected list of programs from production library to my personal library in test environment without locking the code. If they could do it, that would solve my issue in a way. Thanks a lot again for looking into this.

---

<div class="post-metadata">

**Author:** ![Mick\_Fitzpatrick](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Mick\_Fitzpatrick](https://techcommunity.softwareag.com/u/Mick_Fitzpatrick)\
**Post date:** [January 8, 2014, 3:18pm UTC](https://techcommunity.softwareag.com/t/copy-natural-program-to-a-dataset/173792/6 "2014-01-08T15:18:20Z")

</div>

It’s a simple enough matter to write a process to do this. We are mainframe OS natural here so this may need to be adapted for other environments.

Create a TSO dataset list of the library/modules you want  
Create a program that you can run in batch that reads this list and uses the USR exits from SAG to read the source and write to a work file - not sure which one off the top of my head but they are documented on SAG website and listed in SYSEXT I think

You can do what you like with the work file after that.

---

<div class="post-metadata">

**Author:** ![Bharanidharan\_Vayalur\_Radhakrishnan](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@Bharanidharan\_Vayalur\_Radhakrishnan](https://techcommunity.softwareag.com/u/Bharanidharan_Vayalur_Radhakrishnan)\
**Post date:** [January 9, 2014, 2:07am UTC](https://techcommunity.softwareag.com/t/copy-natural-program-to-a-dataset/173792/7 "2014-01-09T02:07:56Z")

</div>

Thanks Mick. That’s interesting. Will try it!

---

<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:** [January 23, 2014, 2:06am UTC](https://techcommunity.softwareag.com/t/copy-natural-program-to-a-dataset/173792/8 "2014-01-23T02:06:36Z")

</div>

have you used the Natural SCAN command? that might save you the hassle of exporting the programs.

With SCAN you can specify ranges of program names to scan (ABC\* for all programs starting with ABC). Or you can leverage XREF information to create sets of related programs and scan those.

With XREF data, you often don’t need to scan since it enables you to search and select by variables, programs, data areas, etc). It is usually much more efficient to search via XREF than to SCAN libraries.

---

<div class="post-metadata">

**Author:** ![Bharanidharan\_Vayalur\_Radhakrishnan](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@Bharanidharan\_Vayalur\_Radhakrishnan](https://techcommunity.softwareag.com/u/Bharanidharan_Vayalur_Radhakrishnan)\
**Post date:** [January 23, 2014, 4:14am UTC](https://techcommunity.softwareag.com/t/copy-natural-program-to-a-dataset/173792/9 "2014-01-23T04:14:00Z")

</div>

Thanks a lot Doug. I do use SCANS but they run longer on a huge library. I will try XREF !

---

<div class="post-metadata">

**Author:** ![krishna\_prasad2](https://avatars.discourse-cdn.com/v4/letter/k/22d042/32.png) [@krishna\_prasad2](https://techcommunity.softwareag.com/u/krishna_prasad2)\
**Post date:** [February 17, 2017, 6:46pm UTC](https://techcommunity.softwareag.com/t/copy-natural-program-to-a-dataset/173792/10 "2017-02-17T18:46:29Z")

</div>

I want to compare two programs one in development region and other one is in non-development region. In order to do that I want to copy Natural program to a dataset.

Regards  
K

---

<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:** [February 17, 2017, 6:52pm UTC](https://techcommunity.softwareag.com/t/copy-natural-program-to-a-dataset/173792/11 "2017-02-17T18:52:56Z")

</div>

See Mick’s answer for the best way to do this.

For your comparison purposes, you might also just do a batch job that does LIST PROGRAM \<name | pattern\> and direct the output to a dataset that you can edit and compare.

---

<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 17, 2017, 9:23pm UTC](https://techcommunity.softwareag.com/t/copy-natural-program-to-a-dataset/173792/12 "2017-02-17T21:23:27Z")

</div>

This is one of the many situations where a Single Point of Development (SPoD) environment is so helpful. Just a few clicks in Natural for Windows, and your selected objects are passed to your desktop compare utility.

The modules can be selected from a mainframe, Unix or Windows server, or your desktop Natural environment.

---

<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:30pm UTC](https://techcommunity.softwareag.com/t/copy-natural-program-to-a-dataset/173792/13 "2021-04-02T15:30:02Z")

</div>


