Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Chaining a logical file with a partial key

218 views
Skip to first unread message

Paul Delahunty

unread,
Jan 6, 1998, 3:00:00 AM1/6/98
to

Hi,

I have a file with a 15 lenght alpha-numerick Key field.

The first 2 characters are the sales territory for which there are numerous
combinations. I want to chain to this file ignoring the first 2 characters
of the key field but usign the other 13 characters. Can this be done with
creating a new logical file or without using a complex loop and conc.

Paul


Rick Williams

unread,
Jan 6, 1998, 3:00:00 AM1/6/98
to

Yes, you can accomplish this by creating a logical file. In the logical
file DDS, create a field by substringing the alphanumeric field starting at
position 3.

For example, let us assume that the original, key field is called CHAR15.
You could define a logical file field as...

A CHAR13 SST(CHAR15 3 13)
A*----------------------------------------------------------------
A* Key fields
A K CHAR13

Paul Delahunty <v-pa...@microsoft.com> wrote in article
<68t1rr$8...@news.microsoft.com>...

Ricko

unread,
Jan 6, 1998, 3:00:00 AM1/6/98
to

Yes

Build a new logical file! Add a new field and use the SST (substring) to
section off a piece of the original field.
Then set a Key on this new field!

Alternatively, use a Program described file!

Regards

Paul V Cullen

Bradley V. Stone

unread,
Jan 6, 1998, 3:00:00 AM1/6/98
to

On Tue, 6 Jan 1998 10:43:04 -0000, "Paul Delahunty"
<v-pa...@microsoft.com> wrote:

>Hi,
>
>I have a file with a 15 lenght alpha-numerick Key field.
>
>The first 2 characters are the sales territory for which there are numerous
>combinations. I want to chain to this file ignoring the first 2 characters
>of the key field but usign the other 13 characters. Can this be done with
>creating a new logical file or without using a complex loop and conc.
>
>Paul
>
>

I would say normalize your files first.


Bradley V. Stone
bvs...@usa.net
http://prairie.lakes.com/~bvstone/
1992 Yamaha FJ1200
1969 Suzuki T250
"I was on fire... and I was dry!"

Michael Cape

unread,
Jan 6, 1998, 3:00:00 AM1/6/98
to

Paul,

You could create a view over this file, defining only the items you want to
see.


Paul Delahunty wrote in message <68t1rr$8...@news.microsoft.com>...

Francis Lapeyre

unread,
Jan 6, 1998, 3:00:00 AM1/6/98
to

But bear in mind, that when you create the logical, you need to include
all of the fields in the physical file (referencing them with type R),
or your program won't see them.

Rick Williams wrote:
>
> Yes, you can accomplish this by creating a logical file. In the logical
> file DDS, create a field by substringing the alphanumeric field starting at
> position 3.
>
> For example, let us assume that the original, key field is called CHAR15.
> You could define a logical file field as...
>
> A CHAR13 SST(CHAR15 3 13)
> A*----------------------------------------------------------------
> A* Key fields
> A K CHAR13
>

> Paul Delahunty <v-pa...@microsoft.com> wrote in article

> <68t1rr$8...@news.microsoft.com>...
> > Hi,
> >
> > I have a file with a 15 lenght alpha-numerick Key field.
> >
> > The first 2 characters are the sales territory for which there are
> numerous
> > combinations. I want to chain to this file ignoring the first 2
> characters
> > of the key field but usign the other 13 characters. Can this be done with
> > creating a new logical file or without using a complex loop and conc.
> >
> > Paul
> >
> >
> >
> >

--

Francis Lapeyre flap...@communique.net
____________________________________________________________
| |
| "The probability of life originating from accident is |
| comparable to the probability of the Unabridged Dictionary |
| resulting from an explosion in a printing factory." |
| |
| --Prof. Edwin Conklin |
|____________________________________________________________|

****** Unsolicited commercial e-mail is not tolerated here. *******
****** Senders of such mail do so at their own peril. *******
****** A copy, complete with header, is forwarded to the *******
****** originating ISP for action. *******

Opinions are my own. Otherwise, they are someone else's.

brook...@pensys.com

unread,
Jan 7, 1998, 3:00:00 AM1/7/98
to

Yes it is possible. You need to redefine the fields in the logical file
& then use them as the key fields. This is from the softcopy library-DDS
reference:

hows how to specify the SST keyword on a simple or multiple format
logical file.


|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A R REC1 PFILE(PFA)
A LASTNAME I SST(NAME 10 10)
A K LASTNAME
A


Figure 2-73. Specifying the SST Keyword on a Simple or Multiple Format
Logical File


The LASTNAME field is a substring of NAME from PFA. The usage I in
position 38 must be specified for SST fields in simple or multiple format
logical files.

Hope that helps and you run into better designed files!

In article <68t1rr$8...@news.microsoft.com>,


"Paul Delahunty" <v-pa...@microsoft.com> wrote:
>
> Hi,
>
> I have a file with a 15 lenght alpha-numerick Key field.
>
> The first 2 characters are the sales territory for which there are numerous
> combinations. I want to chain to this file ignoring the first 2 characters
> of the key field but usign the other 13 characters. Can this be done with
> creating a new logical file or without using a complex loop and conc.
>
> Paul

-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet

Paul Delahunty

unread,
Jan 8, 1998, 3:00:00 AM1/8/98
to

Thanks everyone this will be very helpful


Paul Delahunty wrote in message <68t1rr$8...@news.microsoft.com>...

0 new messages