Solved

AS400 Logical Built - How to build logic with variable naming

Posted on 2011-03-10
5
1,107 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks Gary,

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

Lynn
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

11 Experts available now in Live!

Get 1:1 Help Now