NAT3041 in referring file which has new PE and MU field

Hi All,

I added 1 PE field and 1 MU field to the existing file and tried used in my program ABC. I had two views defined in a LDA.

One with basic old fields in VIEW-1. VIEW-2 holds the new fields including the PE and MU fields along with the old one

Say, my pseudo code was like listed below.

FD1. FIND VIEW-1 with Key



GT1. GET VIEW-2 *ISN (FD1.)
move
move
move
UPDATE (GT1.)

Doing end transaction based on ET counter of 50.

When i execute the program through BATCH mode, its getting ABEND exactly while referring the GET statement with NAT3041.

I had no clue how to find the issue. Also i had properly used the database fields with proper VIEW qualifier.

There are, as you probably are aware, many possibilities for a NAT3041. There is a lot of information missing from your post that would help:

First, do you get the 3041 for the first record that would be updated? If not, that is if you successfully did previous GET and UPDATEs, you probably have a subscript error.

Do you get the 3041 on the GET (most likely) or the UPDATE.

Could you show us the definition of the PE GROUP (not field; there is no such thing as a periodic field. There are fields within a periodic group) and the MU field.

Have you tried removing the MU or PE and running a test with a View that just has the MU, or just has the PE? That might narrow the problem down a bit.

Typically this indicates a conflict between Natural and Adabas. Natural knows about the new fields; that is, the Data Definition Module (DDM) is accurate. If it wasn’t, your program would neither compile nor run. I’m guessing that you haven’t notified Adabas by updating the Field Definition Table (FDT).

Hi Ralph,

We did the proper updation to FDT. That would be the fine. Right?

Steve,
Actually What i had done last evening is declared a view with those new defined MU and PE fields and wrote an adhoc to display those fields along with old one. it works fine. Likewise, sameway i deleted the view which was declared in my LDA. Then again included it. But unfortunate, it got same error in very first record on GET statement.

I had attached the view declaration in this post.

But when i use the same ISN and write an adhoc using GET statement to display the records,it working fine.

Kindly help. also please let me know if needed any more information.

NAT3014 error - View definition.doc (28.5 KB)

Hi Team,

Just to give an update on the issue.

Its working for MU and PE fields. If i remove or comment the group fields like

  • 2 SUBMITTOR-DETAILS
  • 3 EMPLOYEE-NUMBER
  • 3 EMPLOYEE-NAME
  • 3 HR-ORG-UNIT-NAME
  • 3 HR-ORG-UNIT-NUMBER
  • 3 SUBMIT-DATE
  • 2 INCIDENT-DESC
  • 3 INCIDENT-DESC-1
  • 3 INCIDENT-DESC-2
  • 3 INCIDENT-DESC-3

then its working fine. I had no clue what wrong with the group fields.

Also it throws the same error when i try to move any values to the existing PE fields. so i removed the code and it works fine. But i should update those fields with values in my program.

2 C*UPDATE-DETAILS
2 UPDATE-DETAILS(1:10)
3 UPDATE-USER-ID
3 UPDATE-DESC
3 UPDATE-DATE
3 UPDATE-TIME

(This is the existing PE field and i commented those line of codes)

  • MOVE C*UPDATE-DETAILS TO #CNT
  • MOVE *INIT-USER TO UPDATE-USER-ID(#CNT+1)
  • MOVE ‘PADIF’ TO UPDATE-DESC(#CNT+1)
  • MOVE *DATX TO UPDATE-DATE(#CNT+1)
  • MOVE *TIMX TO UPDATE-TIME(#CNT+1)

When you receive the 3041, immediately execute the LASTMSG command and post the results.

Hi Ralph,

I am executing through the BATCH job. so not sure how to use the LASTMSG in BATCH.

execute the LASTMSG before the FIN statement.

LASTMSG
FIN

Hi helmut

i tried that too.

//CMPRINT DD SYSOUT=*
//DDPRINT DD SYSOUT=Z
//DDRUCK DD SYSOUT=Z
//SYSOUT DD SYSOUT=*
//CMSYNIN DD *
LOGON LIBRARY-NAME
PROGRAM1
LASTMSG
FIN
/*

but no difference. I get the same error message even if i dint give the LASTMSG.

NAT9987 Natural session terminated abnormally - RC=033.
******************************** BOTTOM OF DATA ********************************

Now we have to deal with 2 error messages: NAT9987 and NAT3041

NAT9987 Natural session terminated abnormally - RC=033
This means: The Natural session was terminated by a TERMINATE statement with return code 33 in a Natural program (TERMINATE 33). The TERMINATE is user written in a Natural program.

How do you get the information about NAT3041?

The Natural error NAT3041 is adabas response 41, which has a lot of subcodes. The information about the subcode is available with userexit USR2010N (Display DB error information). CALLNAT the userexit in an ON ERROR block. Depending on the program flow the ON ERROR is perhaps not executed because of the TERMINATE statement.

Yes Helmut.

I have TERMINATE 33 in my code in ON ERROR block. This is the error message i get and line number 3680 indicates the GET statement.

  • ERROR IN PROGRAM: PROGRAM1 *
    • LINE NUMBER : 3680 *
    • ERROR NUMBER: 3041 *

when i tried using USR2010N in my program, i got the below information.

TYPE (A1) - 7
DBID (B2) - 00F1
FNR (B2) - 001F
CMD (A2) - L4
RESP (B2) - 0029
SUBCD (B2) - 0004

Error message is 3750 NAT3041 Error in format buffer. DB/FNR/Subc/field 241/31/4/DO.

Error Number: 3041
Error Line: 3760
Object Type: Program
Level: 1
DBID/FNR: 241 / 11
Error Class: System
Error Type: Runtime
Error Time: 2014-10-08 20:57:28

Hope this information somewhat help you in providing me some solution.

thanks in advance and sorry for improper formatting.

In your adhoc

Reinsert the statement: MOVE C*UPDATE-DETAILS TO #CNT
Then WRITE ‘=’ #CNT

Is #CNT already at the max value? So when you add 1 you are outside the range?

This should though, produce an error regarding subscript out of range.

Do you know how to use DBLOG? This could show us the contents of the Format buffer. Might be useful.

Could you reinstate the MU field only in the adhoc and see if it runs?

Then get rid of the MU and try the PE, but, with fewer occurrences. If that works, expand to the proper number of occurrences (perhaps you have blown the Format buffer). If that doesn’t work, change the PE field definitions by eliminating the range (e.g. 2 UPDATE-DETAILS not 2 UPDATE-DETAILS (1:10). Then for the following fields, add (1:10) after UPDATE-USER-ID . -DESC, etc. This reduces the size of the Format buffer.

One more question.

Are the fields within the PE, and the MU, null suppressed or not null suppressed?

Hi Steve,

All the fields including PE and MU are Null suppressed in the file. i had confirmed as when i list the file, it shows “N” in the S column. It means Null suppression. Correct me if i am wrong.

T L DB Name F Leng S D


G 1 CU INCIDENT-DESC
2 CV INCIDENT-DESC-1 A 250 N
2 CW INCIDENT-DESC-2 A 250 N
2 CX INCIDENT-DESC-3 A 250 N
P 1 CY DRIVER-INTRVW-QUESTN
2 CZ STATUS A 1 N
2 DB STATUS-DESC-1 A 200 N
2 DC STATUS-DESC-2 A 200 N
1 DD OTH-ACTION-COMMENTS-1 A 250 N
1 DE OTH-ACTION-COMMENTS-2 A 250 N
1 DF DRIVERS-ORG-CODE A 6 N
1 DG ORG-UNIT-NR N 8.0 N
1 DH ORG-UNIT-NAME A 40 N

Also in my ADHOC program as well the Main program, I am getting the NAT3041 error while accessing the VIEW itself. so its not executing the other line of codes.

:frowning: :frowning: :cry:

According to the ADABAS documentation Adabas response 41 subcode 4 means: A field name was undefined or not elementary.

The field in question is the field with the Adabas short name DO. I assume you generate the Adabas file and the DDM with Predict.

If you compare in Predict the Adabas file and the userview, from which the ddm was generated, do their definitions match? The direct command for invoking the screen “Difference of files” is diff file.

1 Like

Hi Helmut,

As per the error message, you saying the issue is with

NAT3041 Error in format buffer. DB/FNR/Subc/field 241/31/4/DO.

“DO” DB name is present in new group field. so anything wrong with the declaration of this field.

T L DB Name F Leng S D Remark


G 1 DN SUBMITTOR-DETAILS
2 DO EMPLOYEE-NUMBER N 8.0 N
2 DP EMPLOYEE-NAME A 45 N
2 DQ HR-ORG-UNIT-NAME A 75 N
2 DR HR-ORG-UNIT-NUMBER N 8.0 N
2 DS SUBMIT-DATE N 8.0 N

Also i am unsure how to INVOKE the screen “Difference of files”. kindly advice.

Counting down, it looks like DO would be UPDATE-DETAILS, which appears twice in the listing you sent??

Hi Steve,

In the earlier attached word doc which contains the list of fields used in the view - i included the existing PE field UPDATE-DETAILS along with the counter field.

C 2 UPDATE-DETAILS —> counter field
P 2 UPDATE-DETAILS
3 UPDATE-USER-ID A 8 (1:191) /* FIELD IN P
3 UPDATE-DESC A 5 (1:191) /* DESCRIPTIO
3 UPDATE-DATE N 8.0 (1:191) /* FIELD IN P
3 UPDATE-TIME N 7.0 (1:191) /* FIELD IN P

In the error message, NAT3041 Error in format buffer. DB/FNR/Subc/field 241/31/4/DO. ,

Will the Issue with the newly defined group field as it hold the DB name as DO.

T L DB Name F Leng S D Remark


G 1 DN SUBMITTOR-DETAILS
2 DO EMPLOYEE-NUMBER N 8.0 N
2 DP EMPLOYEE-NAME A 45 N
2 DQ HR-ORG-UNIT-NAME A 75 N
2 DR HR-ORG-UNIT-NUMBER N 8.0 N
2 DS SUBMIT-DATE N 8.0 N

If you think that might be the issue, i try delete that definition and try to declare it as elementary field. But can you advice how to delete the defined fields from Physical and logical file? I am using PREDICT to add it.

You have listed the DDM

T L DB Name F Leng S D Remark


G 1 DN SUBMITTOR-DETAILS
2 DO EMPLOYEE-NUMBER N 8.0 N
2 DP EMPLOYEE-NAME A 45 N
2 DQ HR-ORG-UNIT-NAME A 75 N
2 DR HR-ORG-UNIT-NUMBER N 8.0 N
2 DS SUBMIT-DATE N 8.0 N

How is field DO defined in Adabas?

If you want to compare two Predict files in Predict you can invoke the screen with the command: diff file
or on the “File Retrieval” screen with retrieval type “A”

First file ID … → is the Adabas file
Second file ID … → is the userview from which the ddm was generated

1 Like

Hi Balasubramani,

Well, if you are not too familiar with the command “diff file” (just like myself :-), I may describe for you what I would have done.
First, I would go to Predict (Logon SYSDIC)
Then, I`d try to figure out to which Adabas file (type A) is associated (created from) your famous VIEW FLT-ACCIDENT-DETAIL(type U) (it must have the same FNR)
Finally, I’d compare them using “diff file”; most likely, you would get something like:
10:43:25 ***** P R E D I C T 4.6.1 ***** 2014-10-08
Plan 0 - Difference of files -

First file ID …FLT-ACCIDENT-DETAIL*
Second file ID …(the Adabas file from which your FLT-ACCIDENT-DETAIL is generated)

Options
List fields …* D Differences only
Compare file attributes … Y (Y,N)

Mark field attributes which should be compared.
X the order X the existence
X abstract X owner IDs X keywords
X description X field name synonyms X standard file
X verifications X Adabas attributes X field definition
X Natural attributes X specification for 3GL X VSAM attributes
According to Helmut (to whom I trust 100% regarding this subject), you would realize there`s some difference in definition of that field DO.

Best of luck,
Nikolay