Creating a Schema on AS/400

750 pts.
Tags:
AS 400
iSeries
I have a standard library on my iSeries that contain programs, physical files, data areas etc. I will need to copy the entire contents into a schema. How on earth do I do that? I've never done anything like that on the iSeries before. Thank you.


Software/Hardware used:
V7R1M0
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TheRealRaven
    It depends on what you mean by "schema".

    'Library' is the native object type name for a schema in the AS/400 series of systems, having been established before SQL was brought in a almost a couple decades ago. If you run a CREATE SCHEMA statement today, a library will be created as the container.

    However, to match SQL standards, a few additional objects will be created within that library in order fully to support various SQL operations. E.g., a schema journal named QSQJRN (plus an initial receiver) will be automatically created as well as the various database catalog VIEWs. Automatic creation avoids any need to create objects yourself if you want them in a bare library.

    Best might be to run a CREATE TABLE ... AS (select-statement) WITH DATA for each TABLE (physical file) in the source library. That will help populate the SCHEMA TABLEs with current data while appropriately setting up the SCHEMA catalog VIEWs. You might also add a NOT LOGGED INITIALLY clause so that the initial copying of the TABLE rows doesn't log journal entries, but that will depend on what your logging requirements are.

    That takes care of most of the data. For programs and other objects, it can depend on their purposes. Trigger programs/procedures should be recreated in the new SCHEMA for example. I don't think that I'd want basic application programs, DSPFs, etc., put into the SCHEMA though. These aren't known to SQL and technically violate common database maintenance guidelines, requiring maintenance procedures not part of SQL.

    Beyond that, it might require some specific details to suggest what might be done.
    33,610 pointsBadges:
    report
  • Happyjoe
    Use the CRTDTADCT (create data dictionary command). It will create a library with all the catalog tables an SQL database will have including journaling. The library or datadictionary would be the schema.
    20 pointsBadges:
    report
  • TheRealRaven
    The CRTDTADCT command creates neither the SQL catalog tables/views nor the journal. It is intended to be used for the Interactive Data Definition Utility (IDDU) facility which, among a couple other things, can be used as a way to overlay field-level descriptions on a program-described file.

    But it's not very useful for creating schemas for SQL.
    33,610 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: