Local Data Area

Is there a way to print out a Local Data Area with starting and ending positions for every field defined in the local?

Say you have a local that is A1000 and you redefine it in to 50 different fields.

Type A4
Amount N9.2
Obj A1
and so on…

Print out —

Type 1 to 4
Amount is 5 to 15
so on…

Or how to do that programmatically? Your natural program would only include the local and the output would be the field names, start position, and end position??? So a data dictionary that has the positions instead of (or in addition too) the field type.

Thank you

Coding your own in Natural is a daunting task if you intend to handle all the Data Editor’s options.

Import your data area into Predict, then generate a COBOL copybook. When Predict lists the copybook, it will include each field’s starting position.

I have some code to map a Natural Data Area, field by field, showing displacements of each element and group therein. It reads FUSER to get the LDA, PDA or GDA and builds a table of its structure, which can be displayed or used for an application.
I can provide source code for this via email if you wish; or is there a spot to post for all to access?

Natural Code Samples is found under Natural General.

I have now added my solution to this requirement to the Code Samples for Natural. The relevant objects are NDAMAP (program) and NDATABLE (subprogram).

Did you actually post this Kevin ? I’m interested in this as well, but the last post in the Code samples forum is from November…

thanks,
Ronald

I can’t find it posted either.

Appears to be  here

Were you guys able to get the code OK? If it’s problematic I can email unloaded files directly. Cheers KDT

Yes, I got it now. Will give it a try later. Thanks Kevin & Wolfgang.

Ronald

Kevin,

our FUSER still has the old layout (so SRCTX = A90). Do you maybe have an example of how the second redefinition of SRCTX in NDATABLE should look in this case ?

thanks,
Ronald

Hmm… what version of Natural are you? We are v426 so I can no longer see older formats.
It may be a case of activating (un-commenting) a few display statements in NDATABLE to see its format, then adjusting the SRCTX definition to match.
Also, what value do you get for +NDA-INTERNAL-FMT?
Kevin

We are actually on 8.2 :slight_smile:

I did get it work for LDA’s in the old format, but when I create a new LDA it fails. I think the problem is with our DDM, which has not been regenerated since 1998… I will go talk to our DBA first.

Thanks.

We will be installing Nat v8.2 soon, then I’ll be able to test and make any updates necessary for compatibility and repost the source. For now I’m on leave - back in February. Cheers, Kevin.