# how would u write a programo achieve the following  in Adabas Natural

**URL:** <https://techcommunity.softwareag.com/t/how-would-u-write-a-programo-achieve-the-following-in-adabas-natural/172551>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Adabas-Code-Samples\
**Created:** [September 9, 2013, 11:02pm UTC](https://techcommunity.softwareag.com/t/how-would-u-write-a-programo-achieve-the-following-in-adabas-natural/172551 "2013-09-09T23:02:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![josepnass](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/josepnass/32/169_2.png) [@josepnass](https://techcommunity.softwareag.com/u/josepnass)\
**Post date:** [September 9, 2013, 11:02pm UTC](https://techcommunity.softwareag.com/t/how-would-u-write-a-programo-achieve-the-following-in-adabas-natural/172551/1 "2013-09-09T23:02:52Z")

</div>

please read the following specs:

Program Spec;

Please write a Natural program geared to run as a batch process. The program is to generate two reports, update the database Status file and generate an extract file.

Program Name: TESTWAGE

```
            Note: Include Documentation in the program header

```

Update Requirement:

Update the LPO-PRIOR-LOAN-BAL and LPO-PMT-RCVD fields as follow

1. 

```
       LPO-PRIOR-LOAN-BAL is the loan balance before current payment is applied. Each time TESTWAGE program runs, this field is updated with LPO-PMT-RCVD.

```

2. 

```
       LPO-PMT-RCVD is the current payment made by the member that should go against his/her loan balance. When step 1 is satisfied reset the LPO-PMT-RCVD field to 0. 

```

3. 

```
       TESTWAGE program does not update the record when LPO-PMT-RCVD is negative instead report it in the exception report.

```

Extract Criteria

The Extract file (DSN not a temp) is for all members who have paid their dues, with LPO-PRIOR-LOAN-BAL = 0 after current payment has been applied. Extract file should contain SSN, LOAN-AMOUNT and the first 3 occurrences

of NOTIFY-MSG.

Report 1 Spec

Produce a report for wage history

Report Header footer information:

Header- Title: Member Wage History

```
            Report Date: Current date

```

Sub-header: Field Name

In the footer include page number

Report output fields:

SSN,

LOAN-AMOUNT,

Member’s age (calculated)

Display only the WHT-WAGE of the 15th year

Note: the 15th year wage is determined based on the following: WAGE-HISTORY-TABLE contains wages earned by members, for each year from the time he/she became a member using MEMBERSHIP-DATE.

Selection Criteria:

• Members who have paid their dues: DUES-ALL-PAID-IND = “Y”

• And who have LPO-PRIOR-LOAN-BAL = 0

?

Report 2 Spec

Produce an exception report

Report Header footer information:

Header - Title: Exception report

Sub-header: Field Name

In the footer include page number

Report output fields:

SSN,

LPO-PMT-RCVD,

Total Count of the exception records reported

Selection Criteria:

• LPO-PMT-RCVD is negative

JCL and Script Spec;

Produce JCL that will run program in Mainframe, as well as equivalent SCRIPT for UNIX execution.

Please write a NATURAL code according specs.

---

<div class="post-metadata">

**Author:** ![Ronald\_Wijchers](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@Ronald\_Wijchers](https://techcommunity.softwareag.com/u/Ronald_Wijchers)\
**Post date:** [September 10, 2013, 11:17am UTC](https://techcommunity.softwareag.com/t/how-would-u-write-a-programo-achieve-the-following-in-adabas-natural/172551/2 "2013-09-10T11:17:34Z")

</div>

Do you really expect us to write the program for you ? I would suggest some education in Natural first, then maybe we can help you with any remaining questions. But if you get an education of any standard, you should be able to write such a program easily.

regards,  
Ronald

---

<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 10, 2013, 12:55pm UTC](https://techcommunity.softwareag.com/t/how-would-u-write-a-programo-achieve-the-following-in-adabas-natural/172551/3 "2013-09-10T12:55:31Z")

</div>

This looks suspiciously like a job interview question.

If so, kudos to the company for covering the Natural basics in such a nice format.

---

<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:29pm UTC](https://techcommunity.softwareag.com/t/how-would-u-write-a-programo-achieve-the-following-in-adabas-natural/172551/4 "2021-04-02T15:29:26Z")

</div>

Closed on April 2, 2021, 3:29pm UTC


