Answer Wiki

If I understand your question correctly, on the AS400 you can use sql to create a file or logical view, or table, whatever you want to call it. The command is STRSQL to get into sql then the sql command to create a table is CREATE VIEW filename AS SELECT fieldnames etc. You will need to lookup sql commands but that is the basic command that will create a logical view of a physical file. I have one with a file name that is ten characters long and ten character long field names, since you asked about length
here is an example

CREATE VIEW filename AS SELECT field1 AS field1descriptivetext, COUNT(field2) AS field2descriptivetext FROM library.physicalfile GROUP BY fieldname

===============================================================

The STRSQL command will only be available if your system has the SQL Development Kit product installed, and probably licensed, too. Most production systems have it nowadays.

If it’s not available, SQL statements for creating SQL objects can still be created by entering the CREATE statements into a source file member. The member is then used as input to the RUNSQLSTM command. Multiple statements can be in a member, each one separated by a semi-colon as the statement terminator.

Also, the PC iSeries Navigator program includes a Run SQL Scripts function. SQL can be developed on your PC and sent to your AS/400 for execution.

There are other possibilities, but those two are easily available to everyone (who has authority). No additional product licenses needed.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your response...

Discuss This Question: 1 &nbspReply

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

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Hi,
You can create views on the AS400 using the CRTLF (Create Logical file) command. On this command you will need to supply the name of a source file which points to the physical file(data file) and describes the key sequence of the view. You need to crease the source file first using the STRPDM facility.
Cheers!

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your reply...

Ask a Question

Free Guide: Managing storage for virtual environments

Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!

To follow this tag...

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy