× 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.



It has been eons since I worked with this code but I _think_ that you can avoid some issues by specifying the record format rather that specifying ALL-FORMATS. That is really only intended for printer and display files and causes additional redefines that aren't needed with database since you only ever have one record format. Well assuming we have all forgotten about multi-format logicals anyway!



On May 19, 2020, at 1:10 PM, Paul Nicolay <paul.nicolay@xxxxxxxxxx> wrote:

Hi Jon,

The conflict of the record format and file name was indeed what caused the issue.

I now added RCDFMT to my SQL DDL statement and it compiles fine now.

I did need a replace to keep the rest of the program the samen;

01 MYFILE-RECORD.
COPY DD-ALL-FORMATS OF ENTRY REPLACING MYFILER BY MYFILE-REC.

This way I can MOVE TO FIELD OF MYFILE-REC.

@Basil, yes the EXEC SQL BEGIN DECLARE SECTION END-EXEC is in the program but it wasn't mentioned here.

Kind regards,
Paul
________________________________________
From: COBOL400-L <cobol400-l-bounces@xxxxxxxxxxxxxxxxxx> on behalf of Jon Paris <jon.paris@xxxxxxxxxxxxxx>
Sent: Tuesday, May 19, 2020 18:13
To: COBOL Programming on the IBM i (AS/400 and iSeries)
Subject: Re: [COBOL400-L] Simple COPY of SQL table definition

There is no real difference between a DDL and DDS defined file in this context.

What did you call the file? The biggest difference between a DDL and DDS table is that by default the DDL table will have a record format with the same name as the file. So if you have used the file's real name you'll have a collision between the generated 05 MYFILE and the actual file name.

I see nothing else wrong with the generated record.


On May 19, 2020, at 11:55 AM, Paul Nicolay <paul.nicolay@xxxxxxxxxx> wrote:

Hi Jon,

This is wat is being generated;

01 MYFILE-REC.
COPY DD-ALL-FORMATS OF MYFILE.
05 MYFILE-RECORD PIC X(35).
* I-O FORMAT:MYFILE FROM FILE MYFILE OF LIBRARY MYLIB
*
05 MYFILE REDEFINES MYFILE-RECORD.
06 USER PIC X(8).
06 DATW PIC S9(7).
06 APPN PIC X(1).
06 ENTN PIC S9(3).
06 TPRN PIC X(10).
06 TENT PIC X(1).
06 CADI PIC S9(1).
06 APPNLI PIC X(1).
06 ENTNLI PIC S9(3).

Maybe this is caused by the fact that it is an SQL table... I'll try to define another record-format.

Kind regards,
Paul
________________________________________
From: COBOL400-L <cobol400-l-bounces@xxxxxxxxxxxxxxxxxx> on behalf of Jon Paris <jon.paris@xxxxxxxxxxxxxx>
Sent: Tuesday, May 19, 2020 16:55
To: COBOL Programming on the IBM i (AS/400 and iSeries)
Subject: Re: [COBOL400-L] Simple COPY of SQL table definition

What are the actual generated lines it is complaining about?

On May 19, 2020, at 10:42 AM, Paul Nicolay <paul.nicolay@xxxxxxxxxx> wrote:

?Hi,


I'm trying to include the record layout of my SQL table as follows;


01 MYFILE-REC.
COPY DD-ALL-FORMATS OF MYFILE.

But I keep getting compile errors on it ?

LNC1203 Expected data-name/FILLER after level-number; found 'MYFILE'. Data description entry ignored.
LNC0239 PICTURE clause cannot be specified for group item 'MYFILE-RECORD'. PICTURE clause ignored.?

Am I missing something stupid ?

Kind regards,
Paul

--
This is the COBOL Programming on the IBM i (AS/400 and iSeries) (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/cobol400-l.


--
This is the COBOL Programming on the IBM i (AS/400 and iSeries) (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/cobol400-l.


--
This is the COBOL Programming on the IBM i (AS/400 and iSeries) (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/cobol400-l.


--
This is the COBOL Programming on the IBM i (AS/400 and iSeries) (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/cobol400-l.


--
This is the COBOL Programming on the IBM i (AS/400 and iSeries) (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/cobol400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.