Trying to do my own DDM query on Natural

Hi all

I am trying to do my own Natural tool to query DDM ,
I want to send a DDM and ddm field and display my query,
I dont want to write one program every time a need a DDM query

I already use NATURAL ONE , it has a decent DDM data browse but
it need more deep filters .

All example i found in internet but its doesnt work .
[http://scctoolkit.atspace.com/zfldcnt.html

0010 ************************************************************************
0020 * Copycode : ZFLDCNT
0030 * Desc : Generate a pgm to give a "histogram" for a non key field.
0040 * Written By : PSM 27/11/09
0050 *
0060 * Parms:
0070 * &1& = Name of your DDM
0080 * &2& = Name a non key field in your DDM to get the stats
0090 * &3& = Name of the Key field in your DDM to report sample record
0100 * &4& = Heading for report.
0110 *
0120 * Usage:
0130 * 0010 INCLUDE ZFLDCNT
0140 * 0020   'MY-DDM' 'MY-NON-KEY-FIELD' 'MY-DDM-KEY'
0150 * 0030   '"Usage stats for MY-NON-KEY-FIELD"'
0160 * 0040 END
0170 *
0180 ************************************************************************
0190 *
0200 DEFINE DATA LOCAL
0210 1 DDM VIEW OF &1&
0220   2 &2&
0230   2 &3&
0240 1 #CNT      (P8)(HD='Count')
0250 1 #FIELD    (A32)
0260 1 #FILE     (A32)
0270 1 #ISN      (P10)
0280 1 #PC       (P3.2) (HD='%')
0290 1 #TITLE    (A60)
0300 1 #TOT      (P8)
0310 END-DEFINE
0320 FORMAT ZP=ON SG=OFF
0330 *
0340 #TITLE := &4&
0350 MOVE RIGHT #TITLE TO #TITLE
0360 EXAMINE #TITLE FOR FULL ' ' REPLACE ' '
0370 *
0380 WRITE TITLE LEFT *DATE
0390   #TITLE
0400   75T 'Pg' *PAGE-NUMBER (EM=Z9)
0410 *
0420 READ MULTI-FETCH OF 2000 DDM
0430   ADD 1 TO #TOT
0440 END-ALL
0450 *
0460 SORT BY &2& USING &3&
0470   AT BREAK &2&
0480     #PC := (#CNT * 100) / #TOT
0490     DISPLAY #CNT #PC 2X
0500       OLD(&2&)
0510       OLD(&3&)
0520     RESET #CNT
0530   END-BREAK
0540   ADD 1 TO #CNT
0550 END-SORT
0560 *

I would like to do a custom DDM data browse tool .

I tryed everything but it doesnt work.

thx
(sorry for my mistakes with english)

What you are attempting can be a daunting task. Others have tried. https://tech.forums.softwareag.com/t/dynamic-source-code-generation-seems-impossible-with-naturalone/102727

It would help if you would list specific problems, rather than “it doesn’t work.”

Your code sample is based on Natural’s Dynamic Source Text Creation/Execution feature. Refer to the documentation on the RUN statement. I don’t think the RUN statement works properly in ONE, so you may need to test your code in your target (native Natural) environment.

If you can get the RUN statement to work, then remember that SCC Toolkit was developed for mainframe use. If the components you need happen to use READ statements to access Adabas FUSER (source code) or FDIC (Predict DDMs) files, you will need to replace them with user exits (SYSEXT), because ONE maintains source and DDMs in the file system, not Adabas.

if you go to the “Report” tab on the Data Browser, you can choose how you want to access your data - physical (default), by ISN, by any Descriptor and provide start/end values and limits to number of records retrieved.

Once you have the data in a report, you can sort it by any column, ascending or descending. Extract the report as a CSV and you and play with it as a spreadsheet (e.g. in Excel).

Thx for reply.

I already use Data Browser , it only let search with descriptors fields. I need report data to my customer on test fase program i need arrange data in colum :

Register 1->>>>
-field 1.
-field 2
-field 40
-Field N

With data Browser i can only have this format ->>>

register 1 field1 field2 field3

This format doesnt fit in 1 screen line when you have 40 fields in one line.

Thx for reply

“it doesn’t work.” sorry for this , this is a example of my mistakes with english :frowning: In my mother language i can explain better but i promise i take note for future topics. thank to you again.

I have acces to mainframe console and Natural One , i use both every day. I need to send a documentation report to my costumer , I need report 40 fields (in column) with data browser i cant do that, i am doing my own program in mainframe for reports.

I dont want to rewrite everyday a program to do reports , changing data definition when i need to query a different ddm, rewriting half code every day.

But your reply help me a lot.

Sorry again for my mistakes with english , and thank you for you help again.

I have created a Data Browser report with 41 fields. What error are you getting when attempting this?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.