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



Is the * in from of Working Storage a typo or do you indeed have it
commented out?

-----Original Message-----
From: D Meza [mailto:mezazerlin@xxxxxxxxx] 
Sent: Wednesday, October 08, 2003 10:26 AM
To: COBOL Programming on the iSeries/AS400
Subject: Re: Question: Major Differences Between COBOL/400 and ILECOBOL


 
 
When I code a "SELECT * " in my COBOL/400 program and  reference a working
storage area   "01 HOST-COM" that defines the elements in my table. When I
do this the compiler gives an error that the "01 HOST-COM" work area cannot
be referenced, could you maybe tell me why this might be happening?
 
EXAMPLES:
 
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).
 
My physical file that I'm selecting from is externally defined, all I have
to do is reference the  table element names.  I do not have a copy statement
in my program where I reference the DDSSRC for physical file SCOMP nor do I
have a copy statement that references the copybook for elment names in the
table.  I have created my own I/O area in working storage to hold the fields
that I select and it just happens magically in my COBOL Program.  However,
this will not work for a "SELECT *"  Could you help me in understanding why
I'm not getting the select all to work.  Thanks for any help you give me.
 
D. Meza
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * *  * * *   
"R. Bruce Hoffman, Jr." <rbruceh@xxxxxxxxxxxxx> wrote:
you can do imbedded SQL from both COBOL/400 and from ILE COBOL.

Yes, you must use the INTO in embedded SQL. That's not COBOL, that's just
SQL. The interactive SQL is doing dynamic calls and looking at the returned
descriptor and then formating those fields for output appropriately. If you
really want to do this in your COBOL program, you have to use the SQLDA area
also. It is *not* trivial.

The major thing you have to understand in ILE COBOL, is the ILE environment
and activation groups. Overrides and call levels and run units all function
differently in ILE activation groups. If all you do is call a COBOL program
directly and it performs no calls, then the subject can be moot.
Otherwise.... learn ILE environment first.

IIRC the intrinsic functions are not available in COBOL/400. It's been so
long since I've used that dialect.


===========================================================
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

----- Original Message ----- 
From: "Jim Essinger" 
To: "COBOL Programming on the iSeries/AS400" 
Sent: Tuesday, October 07, 2003 6:52 PM
Subject: Re: Question: Major Differences Between COBOL/400 and ILECOBOL


> D,
>
> ILE COBOL is very much like OPM COBOL. In most cases you would not see 
> much difference except for a few new verbs. I don't remember if OPM 
> COBOL had access to the INTRINSIC FUNCTIONS, but I know that I use 
> them all the time in ILE COBOL. The biggest difference I can think of 
> is that you can make your COBOL code more modular using the ILE, and 
> not pay the performance hit in calls to a lot of smaller programs.
>
> You _can_ do more with the ILE, but you don't have to. ILE, I believe, 
> will let you do imbedded SQL, where OPM COBOL won't.
>
> Most times you can simply re-designate your source code as CBLLE and 
> compile as normal.
>
> HTH,
>
> Jim Essinger
> Senior Programmer/Analyst
> Student Loan Fund of Idaho
>
>
> At 11:49 AM 10/7/2003, you wrote:
> >Hello,
> >
> >I have been attempting to code COBOL/400 , however, when I've tried 
> >to find reference material I usually encounter examples of ILE COBOL 
> >instead of COBOL/400. Could you tell me what are the major 
> >differences? Are
they
> >similar but yet different?
> >
> >I'm new to the AS400 and I'm trying to figure if I can us some ILE 
> >COBOL logic/examples in my COBOL/400 Programs. Another example, when 
> >I invoke "STRSQL" I can query by doing a "SELECT * " without having 
> >to use "INTO" and yet cannot do the same thing in embedded COBOL/ 400 
> >embedded SQL, I'm just wondering why?
> >
> > I hope you can help me iron out the differences. My goal is to work 
> > with COBOL/400 at this time, I'm just trying to reference the 
> > correct form. I appreciate any help you could give me. Thanks.
> >
> >D Meza
> >
> >
> >
> >---------------------------------
> >Do you Yahoo!?
> >The New Yahoo! Shopping - with improved product search 
> >_______________________________________________
> >This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) 
> >mailing
list
> >To post a message email: COBOL400-L@xxxxxxxxxxxx
> >To subscribe, unsubscribe, or change list options,
> >visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
> >or email: COBOL400-L-request@xxxxxxxxxxxx
> >Before posting, please take a moment to review the archives at 
> >http://archive.midrange.com/cobol400-l.
>
> _______________________________________________
> This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) 
> mailing
list
> To post a message email: COBOL400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
> or email: COBOL400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives at 
> http://archive.midrange.com/cobol400-l.
>

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


---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
_______________________________________________
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/cobol400-l.

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.