× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Yes you can use a period in a prefix statement, just encapsulate it in
single quotes and use upper case characters. That along with the DS
defined likerec and it'll autoload on the read. The Qualified DS is
presumed by that coding.

FSHWTRL88 IF E K DISK prefix('SX.')
F RENAME(SHWTRNF:BREAK)

D SX DS likerec(break) inz

This code autoloads my DS with the read of the record format BREAK.

****
Joe W Holt
Jack Onofrio Dog Shows, LLC
3401 NE 23rd Street
Oklahoma City, OK 73121
405.427.8181

Send RPG400-L mailing list submissions to
rpg400-l@xxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
[1]http://lists.midrange.com/mailman/listinfo/rpg400-l
or, via email, send a message with subject or body 'help' to
rpg400-l-request@xxxxxxxxxxxx

You can reach the person managing the list at
rpg400-l-owner@xxxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of RPG400-L digest..."


*** NOTE: When replying to this digest message, PLEASE remove all text unrelated to your reply and change the subject line so it is meaningful.

Today's Topics:

1. Re: Reading directly into a DS (Stuart Rowe)
2. RE: Reading directly into a DS
(Gundermann, Glenn / Kuehne + Nagel / Tor ZI-A)
3. Re: Reading directly into a DS (James H. H. Lampert)
4. RE: Reading directly into a DS (jdavis@xxxxxxxx)
5. RE: Reading directly into a DS (Kurt Anderson)
6. RE: WORKSTN file problem (DeLong, Eric)


----------------------------------------------------------------------

message: 1
date: Wed, 11 Nov 2009 15:07:32 -0600
from: Stuart Rowe <rowestu@xxxxxxxxx>
subject: Re: Reading directly into a DS

Sorry, viewed code again and the problem is you cannot use a period in a
prefix -- that's only allowed to indicate qualification of data structure
subfiles. Try an underscore instead.



On Wed, Nov 11, 2009 at 15:06, Stuart Rowe <rowestu@xxxxxxxxx> wrote:



You MUST not use the E (external) file type if you intend to use IO with
structures, IIRC. You have to use "F" and state the record length. The
structure size must then match this record length exactly.

Usually I do this with qualified data structures. You'll probably want to
(or use the prefix thing with a really short prefix). For the prefix you
know you can REMOVE letters from the beginning of the external field name?
LIke when your fields all start with MF (master file) you could PREFIX(
'I_':2) or PREFIX('O_':2) and replace that MF with either I_ or O_ (input,
output).

Stu





On Wed, Nov 11, 2009 at 08:53, Kurt Anderson <kurt.anderson@xxxxxxxxxxxxxx
wrote:

Hi Glenn,

Unless I missed it, I don't see where your code loads the I data
structure. Here's a quick (untested) sample of how I would do it.

FFile1 IF E K Disk
FFile2 UF A E K Disk Rename( FileRec: FileRec2 )

D dsFile1 DS LikeRec( FileRec )
D dsFile2 DS LikeRec( FileRec2: *output )

/free

DoU %eof( File1 );
Read File1 dsFile1;
If not %eof( File1 );
dsFile2 = dsFile1;

SetLL dsFile1.key File2;
If %equal( File2 );
Update FileRec2 dsFile2;
Else;
Write FileRec2 dsFile2;
EndIf;

EndIf;
EndDo;


- Kurt Anderson

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [[2]mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Gundermann, Glenn / Kuehne + Nagel / Tor ZI-A
Sent: Wednesday, November 11, 2009 6:59 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Reading directly into a DS

Hi folks,

I'm going in circles here and was hoping someone wouldn't mind helping me.
I'm trying to read data directly into a DS and then write the data to
another file, either with an update or a write, using the data structure.
I know there are different styles, like READ file-name ds-name, and I'm
not sure which is the preferred style.

First of all, we're on V5R4.
This program reads the records from an intermediate file and either
updates or adds them to the master file.
The intermediate file was created using CRTDUPOBJ of the master file,
which is why the record format is renamed.
The files each have 7 fields, of course with the same name.

1. I tried having a meaningful prefix on the F-spec but I received a
compile error RNF2356, I think because there is a limit of 13 to the field
name length.
What can I do to improve this?

2. I'm getting compile time errors:
*RNF7030 30 7 The name or indicator is not defined.
(I.field1, I.field2, etc. for the 7 fields in the file)
*RNF7701 20 2 The data structure is not allowed for the operation.
(Update ACCDOCR I and Write ACCDOCR I)

Any tips would be most appreciated.

Yours truly,

Glenn Gundermann
Work: (905) 501-6596
Cell: (416) 317-3144
glenn.gundermann@xxxxxxxxxxxxxxxx<mailto:
glenn.gundermann@xxxxxxxxxxxxxxxx>




References

Visible links
1. http://lists.midrange.com/mailman/listinfo/rpg400-l
2. mailto:rpg400-l-bounces@xxxxxxxxxxxx

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.