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



----- Original Message ----- 
From: "D Meza" <mezazerlin@xxxxxxxxx>
To: "COBOL Programming on the iSeries/AS400" <cobol400-l@xxxxxxxxxxxx>
Sent: Wednesday, October 08, 2003 10:25 AM
Subject: Re: Question: Major Differences Between COBOL/400 and ILECOBOL


> EXEC SQL
>     SELECT *
>      INTO :HOST-COM
>      FROM TEST/SCOMP
>  WHERE (SCOMCO = 'COMPANYNAME' and
>                SCOMSSN = '999999999')
> END-EXEC.
>
> *Working Storage
> 01  HOST-COM.
>      05  HOST-COM-KEY.
>            10  HOST-COMPNAME    PIC X(11).
>            10  HOST-COMSSN         PIC X(09).


there is a "difficulty" in the precompiler... it only accepts 2 levels in a
structure target. In your example above, the precompiler can not accept
host-com... it could accept host-com-key, and again, only if the two fields
in that structure are the only two fields in the file.

Select * is (IMO) not a recommended practice. It ties your program to the
physcial structure of the data.

When you do a COPY DD, DDR, DDS, etc...  it starts with the record at an 05
level and the fields at an 06 level. If you then reference the 01 level
structure, the precompiler will choke.


===========================================================
R. Bruce Hoffman, Jr.
 -- IBM Certified Specialist - iSeries Administrator
 -- IBM Certified Specialist - RPG IV Developer

"When I die, I want to die like my grandmother who died peacefully
  in her sleep. Not screaming like all the passengers in her car."

    - Author Unknown


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.