Solved

AS400 Logical Built - How to build logic with variable naming

Posted on 2011-03-10
5
1,115 Views
Last Modified: 2013-12-06
I have a physical file where the last two digits of the name are division number and are determined by the user's selection.  (example: XDSOPNL17), multiple file can exist at one time for different divisions.  I would like to build a logical file for these.  (example: XDSOPNL171)  I have tried a few different methods, but the relationship is not established.  The file and logical are built, but when I used DSPDBR.... the logical is not listed.  These files are built and deleted on the fly... not a one time thing.  I will show the DDS(s) I'm using and the commands in a screencast.   Can do listings if needed.

Thank You for your assistance.   lynn-harris-421884.flv
0
Comment
Question by:lynn_harris
  • 2
  • 2
5 Comments
 
LVL 34

Expert Comment

by:Gary Patterson
ID: 35102014
Lynn,

Two things come to mind: library list, and PFILE keyword:

1. Look for another copy of the physical higher in the library list at compile time.  This is the most likely issue.

2. Also check the PFILE keyword in the LF and make sure the correct file name (and library, if a lib used) is specified.

- Gary
0
 
LVL 13

Assisted Solution

by:_b_h
_b_h earned 50 total points
ID: 35102366
Gary is right; the logical is built over something!

Use Display File Description (DSPFD) on the logical file to see what physical file it is based on:
DSPFD WRDATAX/CDSOPNL171
and search for 'Based on file'

Hope this helps!
Barry
0
 

Author Comment

by:lynn_harris
ID: 35102535
Hi Guys,

Yes, the logical is built on the PF specified in the PFILE keyword on the LF definition.  The problem is my lack of knowledge on building PF and LF files.  We have a in house job which allows us to add the LDA to the beginning of the file name (which is really the company identifier) and build that PF.  The logical is then built over the PF with the LDA not the PFILE in the keyword.  I have always use these commands and not needed the actual CRTPF/CRTLF commands much.   When I use the CRTPF/CRTLF commands (not the in house commands)  the logical is always built on the file named the the PFILE Keywork in the LF DDS.  

Let me rephrase the question.  I would like to use one PF DDS and one LF DDS to build multiple files with a one digit company identifier at the beginning of the DDS name and a two digit division code at the end.  Can this be done?

(I will look at modifying the in-house program.  Any insight you can provide is appreciated.)

Thanks,
Lynn
0
 
LVL 34

Accepted Solution

by:
Gary Patterson earned 450 total points
ID: 35103083
When you create a LF (CRTLF), the system first looks at the PFILE keyword.  If a file name AND LIB is specified, then the logical is created over that specific file in that specific lib.

If no lib is specified on the PFILE keyword, then the system searches the LIBL of the job running the CRTLF command and attaches the logical to the first physical it finds in the LIBL with the name that matches the PFILE keyword.

Compile-related solutions:  Include a specific lib in the PFILE keyword, or make sure the lib containing the physical you want to use is at the top of the LIBL before you compile.

You could also use a create and rename approach.  Create the files using your "master" name, and then rename them.

- Gary Patterson
0
 

Author Closing Comment

by:lynn_harris
ID: 35103149
Thanks Gary,

That makes sense.  I like the create and rename approach.

Lynn
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello I read in a discussion about a person who configured a very simple mirror RAID with two hard drives; the system and data were on the same partition. He asked how to repair the system as it was not booting up anymore. In his case running …
Windows 10 is here and for most admins this means frustration and challenges getting that first working Windows 10 image. As in my previous sysprep articles, I've put together a simple help guide to get you through this process. The aim is to achiev…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now