AS400 – DB2 file names

895 pts.
Tags:
AS/400
AS/400 file specification
DB2
Given a view name, how will i find its physical file name...

e.g. my view name is EMP_TMP_TPL_HDR

Thanks,

NG



Software/Hardware used:
AS400 - DB2
ASKED: September 10, 2009  2:12 PM
UPDATED: September 15, 2009  4:16 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

If you use navigator
Select Scemas – for your library
Select Views
Right click view
Generate SQL
– this will generate the create SQL for your view
— files, fields, and where clause
Phil

If you are in the AS400 environment,
you simply type in command DSPFD (Display File Description) followed by VIEW NAME:
DSPFD EMP_TMP_TPL_HDR

then you will be given the file information
which includes the physical file this view is based on
(this is an example)
Based on file . . . . . . . . . . . . . . : ACSSOFP
Library . . . . . . . . . . . . . . . . : ACBPCLIVF
Member . . . . . . . . . . . . . . . . : ACSSOFP
Logical file format . . . . . . . . . . : ACSSOF01

———–
I thought you’ld have that problem with the length of the name
From interactive SQL
select * from QSYS2.VIEWS
or
select * from QSYS2/VIEWS
Phil

———–
that didn’t do much but try
Select * from QSYS2/SYSVIEWDEP

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.

REGISTER or login:

Forgot Password?
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
  • Nutangujar
    IF I use dspfd, it give error - FILE exceeds 10 characters.
    895 pointsBadges:
    report
  • NullFields
    WHen an SQL Object is created with a long name (over 10 characters), IBM generates a system name for it (Unless the SQL CREATE VIEW statement gave it an explicit system name). If IBM Generated it, your view would look something like "EMP_nnnnnn", where nnnnnn is a number sequence assigned at the time of creation. You can do the WRKOBJPDM command on the library where your view resides and filter to EMP* to see a list of objects that fit this naming convention. If the name was explicitly assigned in the SQL, you will need to do one of the other options listed above to find the based on tables and the system name.
    880 pointsBadges:
    report
  • Iamsubbarao
    You can find the equivalent AS400 PF name in SYSTABLES. For ex: you can use below SQL query to find the equivalent AS400 PF name SELECT SYSTEM_TABLE_NAME FROM SYSTABLES WHERE TABLE_NAME = 'EMP_TMP_TPL_HDR'
    60 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.

REGISTER or login:

Forgot Password?
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

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

Following