Using direct commands to create Natural objects

What product/components do you use and which version/fix level?

Running Natural 8.2.7

Are you using a free trial or a product with a customer license?

Licensed

What are trying to achieve? Please describe in detail.

We have a SCM that integrates with Natural 8.2.7. It will take an existing Natural application and load it into the SCM. From then on users can use the SCM to perform all maintenance on the application. What they cannot do is create a new object from the SCM. The integration uses direct commands to invoke Natural. Edit, browse, load and unload work just fine. Is there a way to call the create function? I noticed that if I use the Natural interface to create a new object but do not enter any statements in it, it is not saved.

Do you get any error messages? Please provide a full error message screenshot and log file.

N/A

Have you installed latest fixes for the products

N/A

1 Like

Trying to SAVE / CAT / STOW an empty object will always result in a

NAT0083 SAVE or CATALOG command issued when work area empty.

so you will need to at least add a simple comment line whether you use the API or try the same from the editor interactively.

I wrote a comment, four asterisks, line to a file and then attempted to load the file into Natural using direct commands.

LOAD SALLYR70 LIB TUTORIAL OBJTYPE N WHERE REPLACE

Here’s the result.
Invalid work file version in header record.
Work file record: ***
Error detected in OLNLOAD.
Page 2
SYSOBJH: Error occurred during direct command processing!
Error: 5002
Invalid work file version in header record.
Work file record: ***
Error detected in OLNLOAD.

SYSOBJH terminates with condition code 50
NAT9987 Natural session terminated abnormally - RC=050.

Does your SYSOBJH input file follow this format?

*H**ENAT8207202204251310539MVS/ESA                          4AEMB     08.2          
*C**                                DBALIB  NEWSRC                          F S   N 0000        
*D01NAT8207F DBALIB  NEWSRC                          VSTA003 VSTA003 0851    R      
*D02            2022042513084022022042513084020000000045    
*D03MVS/ESA CICS    NATD
*D04                 IBM01140       
*S*** COMMENT LINE FOR NEW SOURCE CODE          
*S**END     
*E

You may need to add the word TRANSFER to the SYSOBJH command:

LOAD SALLYR70 LIB TUTORIAL OBJTYPE N WHERE REPLACE TRANSFER

This would be true if your format is in “compatibility mode” (e.g., NATLOAD/NATUNLD format).

-Brian

I don’t have the unload format. I’m creating a new object. I’m thinking I must create a file with the expected format. I can reverse engineer this but that can lead to issues if the format changes or my understanding is inaccurate. I was hoping to see if someone has already figured out how to create a new object using direct commands. I would supply a comment line and the rest would be built by the commands.

Brian:
What format is the output you showed for the SYSOBJH input file? I get a different format when I unload an object. I don’t get D01, and so on, headers. Are the leading asterisks binary values?

Why not create a “template object” with just a comment for every possible type and then SYSOBJH LOAD this with the new name ?

1 Like

My colleague and I just came to that idea as well. I’ve not been able to load an object with a new name. Here’s the job output:

NEXT LOGON TUTORIAL
Logon accepted to library TUTORIAL.
NEXT SYSOBJH
Input Command Data or ‘.’ to exit …
Input Command Data or ‘.’ to exit …
Input Command Data or ‘.’ to exit …

DATA LOAD COMMENT LIB TUTORIAL WITH NAME COMMENT NEWN FRED %
DATA WHERE REPLACE
09:44:19 ***** Natural Object Handler ***** 2022-04-26
***** Natural Object Handler *****
***** Natural Object Handler *****
User EFHWFF0D Direct Command Processing Library TUTORIAL
EFHWFF0D Direct Command Processing TUTORIAL
EFHWFF0D Direct Command Processing TUTORIAL
Report Text Member 20944190
20944190
20944190
*** Load Objects ***
Processing Load File created on 2022-04-26 at 08:16
Status Library Object Name Type


Replaced TUTORIAL FRED Progra
Function completed successfully.
Page 2
SYSOBJH direct command processing:

When I check the Natural environment, FRED is not there.

The format I am using comes from the syntax:

UNLOAD NEWSRC LIB DBALIB DBID 100 FNR 17 OBJTYPE N WHERE REPORT TRANSFER

The hex values of this layout are as follows:

***H**ENAT8207202204261100394MVS/ESA                          4AEMB     08.2      **
**5C55CDCEFFFFFFFFFFFFFFFFFFFDEE6CEC44444444444444444444444444FCCDC44444FF4F444444**
**C8CC55138207202204261100394452152100000000000000000000000000415420000008B2000000**
** ------------------------------------------------------------------------------ **
***C**                                DBALIB  NEWSRC                          F S **
**5C5544444444444444444444444444444444CCCDCC44DCEEDC44444444444444444444444444C4E4**
**C3CC0000000000000000000000000000000042139200556293000000000000000000000000006020**
** ------------------------------------------------------------------------------ **
***D01NAT8207F DBALIB  NEWSRC                          VSTA003 VSTA003 0851    R  **
**5CFFDCEFFFFC4CCCDCC44DCEEDC44444444444444444444444444EEECFFF4EEECFFF4FFFF4444D44**
**C4015138207604213920055629300000000000000000000000000523100305231003008510000900**
** ------------------------------------------------------------------------------ **
***D02            2022042513084022022042513084020000000045                        **
**5CFF444444444444FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4444                    **
**C40200000000000020220425130840220220425130840200000000450000                    **
** ------------------------------------------------------------------------------ **
***D03MVS/ESA CICS    NATD                                                        **
**5CFFDEE6CEC4CCCE4444DCEC                                                        **
**C40345215210393200005134                                                        **
** ------------------------------------------------------------------------------ **
***D04                 IBM01140                                                   **
**5CFF44444444444444444CCDFFFFF4444444                                           **
**C40400000000000000000924011400000000                                           **
** ------------------------------------------------------------------------------**
***S*** COMMENT LINE FOR NEW SOURCE CODE                                         **
**5E5554CDDDCDE4DCDC4CDD4DCE4EDEDCC4CDCC4444444444                               **
**C2CCC0364455303955066905560264935036450000000000                               **
** ------------------------------------------------------------------------------**
***S**END                                                                        **
**5E55CDC44444                                                                   **
**C2CC55400000                                                                   **
** ------------------------------------------------------------------------------**
***E                                                                             **
**5C4444444444                                                                   **
**C50000000000                                                                   **
** ------------------------------------------------------------------------------**


I am wondering if your utility default FUSER is not what you expect, and you created “FRED” in some other FUSER than you expect? Possibly changing the nucleus module or overriding this will fix that part.

-Brian

1 Like

I played around with Wolfgang’s idea and it appears to be doable. There is some internal plumbing I need to figure out. Many thanks to Brian and Wolfgang for their insights.

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