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



Peter
You could always execute the commands from your RPG program either using the 
API QCMDEXE or the System program; With the former you will need to bind to 
Q2CLE. The advantage with System is the ability to test the CPF messages 
returned by the call. If you need an example .....

-----Message d'origine-----
De : rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la 
part de rpg400-l-request@xxxxxxxxxxxx
Envoyé : mercredi 20 juillet 2005 13:06
À : rpg400-l@xxxxxxxxxxxx
Objet : RPG400-L Digest, Vol 4, Issue 872

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

To subscribe or unsubscribe via the World Wide Web, visit
        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..."


Today's Topics:

   1. RE: Free format sql,      was: Nice trick for easy viewing
      free-form RPG and embedded SQL (Wilt, Charles)
   2. RE: Embedded SQL - fetching a date (Tyler, Matt)
   3. attaching report(generated by RPG) in email as excel document
      (Banerjee, Amitava)
   4. API's for various commands (Peter.Colpaert@xxxxxxxxxx)
   5. Passing parms in a submitted call from a RPG programm
      (a.perquin@xxxxxxxxxxxxx)
   6. RE: *** ADMIN: Code repository (Ma?oso, Carl)
   7. Passing parms in a submitted call from a RPG programm
      (a.perquin@xxxxxxxxxxxxx)
   8. RE: POI/HSSF default cell formatting (John)


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

message: 1
date: Tue, 19 Jul 2005 16:21:34 -0400
from: "Wilt, Charles" <CWilt@xxxxxxxxxxxx>
subject: RE: Free format sql,   was: Nice trick for easy viewing
        free-form RPG and embedded SQL

> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx
> [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of rob@xxxxxxxxx
> Sent: Tuesday, July 19, 2005 12:07 PM
> To: RPG programming on the AS400 / iSeries
> Subject: RE: Free format sql, was: Nice trick for easy 
> viewing free-form
> RPG and embedded SQL
> 
> 
> I'm Rob, not Ron.  Basically I am not a big fan of externalizing I/O 

Sorry about that Rob,  that 'n' is to close to the 'b'.  :-)

> because it's been my impression that a bulk of the people who 
> are enthused 
> about it are the ones who write the external I/O routines.  Not the 
> consumers of the routines.
> 
> I'd rather write a program that does something like
> FMyFile....
>  /free
>   read(e) MyFile;
>   Dow %status(MyFile)=ReadOk;
>     // process the data
>     read(e) MyFile;
>   EndDo;
>   Select;
>   When %status(MyFile)=EOF;
>     // Ok, don't worry about this one
>   Other;
>     // Oh darn!!!
>     ...
>   EndSl;

Here's my take:

  /free
    monitor;
       StartList(Key1:key2);
       dow GetNextRecord();  
          //process data
       enddo;
    on-error *all;
       //oh crap, now what?
    endmon;


> 
> Than a program that does something like
> /free
> Select;
>   When OpenInventoryData()=Cool;
>     Select;
>     When GetInventoryData(Key1: Key2...)=Cool;
>       MyField1=GetBalance();
>       MyField2=GetWarehouse();
> ...
> Some externalizing gurus might say you wouldn't have a 
> GetInventoryData. 
> Instead the keys would be on the GetBalance, etc.  Then what, 
> does it read 
> a record for each field requested?  I'm not expecting an 
> answer.  It's 
> just a sample of how externalizing may raise more questions than it 
> solves.

As I see it, the real decision here is, how to communicate errors?
Here's some ideas:
  
  // option 1
  if GetRecord(key1:key2);  
        myfld1 = GetBalance();
  else
      myfld1 = *ZEROS;
  endif;

  //option 2
  if not GetBalance(myfld1:key1:key2);
      myfld1 = *ZEROS;
  endif;

  //option 3
  monitor;
    myfld1 = GetBalance(key1:key2);
  on-error *ALL;
    if GetException() = RECORD_NOT_FOUND;
        myfld1 = *ZEROS;
    else;
        //oh crap some other exception what do I do?
    endif;
  endmon;

  //option 4, GetBalance returns 0 if record not found.
  myfld1 = GetBalance(key1:key2);

Since myfld1 gets set to *ZEROS if the record is not found in all the above 
options, then it would seem that option4 makes the most sense, particularly if 
all you usually get out of the file is the balance.

It gets harder when setting myfld1 to *ZEROS isn't the right answer.  If the 
record is often not in the file, then the GetRecord() idea might be best.  If 
the record should be there, then maybe having a exception thrown by the I/O 
service program is not a bad idea.  But it would be nicer if RPG's monitor 
worked like CL's MONMSG.

> 
> Oh, there's the popular myth that if I change a file 
> structure then I do 
> not need to worry about it if I've externalized.  My counter 
> is that a 
> popular package changed the size of their key field and all 
> the rest of 
> their fields.  So if I have a program
> D MyItem         s            15a
> D ItemDesc       s            30a
> I still have issues.  Now, if I've LIKEd these fields off of 
> an external 
> data structure I'm better off.  I still have to compile though.  (And 
> maybe redesign any 5250 screens to change the layout, etc).  
> Then again, 
> isn't using an external method supposed to hide from your 
> developers what 
> the name of the actual physical file is?  If so, how would they know 
> file(s) to use in the data structure(s)?
> 

Ah but you wouldn't need to change anything except the service program that 
does I/O if the file I/O was properly externalized.

So the vendor changed some field sizes.  Unless you _need_ to use the larger 
size, all your routines can simply continue to deal with the smaller size.

You wouldn't want to use a file to define an external DS in anything other than 
the I/O service program.

If you really want to get a DS back from the I/O service program, then simply 
define a DS template without reference to the physical file fields in the 
prototype member for the I/O service program.  The DS becomes simply a part of 
the "contract" between the service program and its callers without being tied 
to the actual structure of a given file.  

Charles Wilt
--
iSeries Systems Administrator / Developer
Mitsubishi Electric Automotive America
ph: 513-573-4343
fax: 513-398-1121
 



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

message: 2
date: Tue, 19 Jul 2005 15:50:40 -0600
from: "Tyler, Matt" <mattt@xxxxxxxxxxxxxx>
subject: RE: Embedded SQL - fetching a date

I certainly learned a thing or two.  I had always set SQL date format to
*USA but left the program at default of *ISO.  I never ran into the "Date,
Time or Timestamp value is not valid" error before because I ended up not
using my date fields from my SQL statement (which pointed out to me that I
was using bloated result sets for no good reason because of external host
structures).  Back to those programs for some redesign soon I suspect. 

Thank you,
Matt Tyler
WinCo Foods, LLC
mattt@xxxxxxxxxxxxxx


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Kurt Anderson
Sent: Tuesday, July 19, 2005 1:59 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Embedded SQL - fetching a date

Matt,

Thanks for sticking with me.
Apparently I had another field in the host data structure incorrectly
defined (Like(a non-existent field)).  This was a copy of some source I
was working with, but apparently was an old copy, which was the cause of
all of my confusion it seems.

I've now come to the same conclusion as you.  I can't explicitly define
a date format field in the host data structure, I need to use a Like().

Thanks again.

Kurt Anderson
Application Developer
Highsmith Inc


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

message: 3
date: Tue, 19 Jul 2005 15:19:08 -0700
from: "Banerjee, Amitava" <Amitava.Banerjee@xxxxxxxxxx>
subject: attaching report(generated by RPG) in email as excel document
        

Hi
We have a CL command that sends email with spool file attached as .WRI format. 
When that email shows up, and the document attached (.WRI) is opened, it opens 
in WordPad, opens fine and is well formatted, as shown below.


REPORT     : LN145BR                 A-PRICE EXCEPTION REPORT                   
     DATE:  7/18/05 TIME: 15:10:50
USER ID    :                            FOR PROPS VS OMNI                       
                        PAGE:    1
                                                   FIN   --------------- PROPS 
-----------------     OMNI
YEAR  GRS1        TOY            DESC             QUOTA  A-PRICE  FOB-PRICE  
DI-PRICE  DDI-PRICE   A-PRICE    NEW
=================================================================================================================
2005  BOYS        B0741   HM DRAGON WALKER                             .00     
10.00      12.18       12.18   Y
2005  BOYS        B0764   MX 4X4 HYDRO QUAD & ZIP                      .00      
7.50       9.79        9.79   Y
2005  BOYS        B1280   SPONGEBOB GIFT PACK                          .00      
4.90       5.59        5.59   Y
2005  BOYS        B1307   UNO ATTACK GAME (PDQ)     Y      17.00       .00      
            .00       17.00   Y
2005  BOYS        B1536   SPONGEBOB LG PLUSH                           .00      
7.00       9.63        9.63   Y
2005  BOYS        B1838   SUPER-BLAST HELICOPTER    Y                  .00     
13.82      17.15       17.15   Y
2005  BOYS        B2069   HW MJ FLAMETHROWER ASST                      .00     
10.36      13.15       13.15   Y
2005  BOYS        B2104   SURP SPONGEBOB ASST                          .00     
10.50      12.11       12.11   Y
2005  BOYS        B2419   SPONGEBOB-24PC ASST       Y       1.45       .00      
            .00        1.45   Y
2005  BOYS        B2665   HW SKATE HEDZ ASST        Y                  .00      
2.49       2.87        2.87   Y
2005  BOYS        B3268   SB SPONGEBOB ON BOARD                        .00      
1.50       1.78        1.78   Y


 
Now, I am trying to attach the document as .XLS, as the upper management wants. 
The email comes fine with .XLS document, but the format of the report is gone 
for some part of the report, as shown below. I also tried to send it as .CSV 
but no success.


REPORT     : LN145BR                 A-PRICE EXCEPTION REPORT                   
     DATE:  7/18/05 TIME: 14:42:05      
USER ID    :                            FOR PROPS VS OMNI                       
                        PAGE:    1              
                                                   FIN   --------------- PROPS 
-----------------     OMNI                               
YEAR  GRS1        TOY            DESC             QUOTA  A-PRICE  FOB-PRICE  
DI-PRICE  DDI-PRICE   A-PRICE    NEW
=================================================================================================================
2005  BOYS        B0741   HM DRAGON WALKER                             .00     
10.00      12.18       12.18   Y         
2005  BOYS        B0764   MX 4X4 HYDRO QUAD & ZIP                      .00      
7.50       9.79        9.79   Y         
2005  BOYS        B1280   SPONGEBOB GIFT PACK                          .00      
4.90       5.59        5.59   Y         
2005  BOYS        B1307   UNO ATTACK GAME (PDQ)     Y      17.00       .00      
            .00       17.00   Y         
2005  BOYS        B1536   SPONGEBOB LG PLUSH                           .00      
7.00       9.63        9.63   Y         
2005  BOYS        B1838   SUPER-BLAST HELICOPTER    Y                  .00     
13.82      17.15       17.15   Y         
2005  BOYS        B2069   HW MJ FLAMETHROWER ASST                      .00     
10.36      13.15       13.15   Y 
 

Please advice.

Thanks in anticipation.

Amitava
 
--------------------------------------------------------

This message (including any attachments) is only for the use of the person(s) 
for whom it is intended. It may contain Mattel confidential, proprietary and/or 
trade secret information. If you are not the intended recipient, you should not 
copy, distribute or use this information for any purpose, and you should delete 
this message and inform the sender immediately.



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

message: 4
date: Wed, 20 Jul 2005 10:31:04 +0200
from: Peter.Colpaert@xxxxxxxxxx
subject: API's for various commands

Hi group,

I'm trying to make kind of a change management command that would enable 
us to promote sources and objects from our development library to the test 
or production library.

Of course I could do this in a CLLE program, using CPYF, CRTDUPOBJ etc, 
but I would like to do this in RPGLE using API's.  Not only do I like RPG 
more than CL, but it gives me more versatility do do SELECT's instead of 
numerous IF's, etc.

Are there API's that allow you to, for instance, move an object, move a 
member (or copy + delete it), change the source type of a source member?

The API finder over at the InfoCenter didn't list anything like this.

Thanks in avance,

Peter Colpaert
Application Developer
Massive - Kontich, Belgium
-----
Yoda of Borg are we.  Futile is resistance, assimilated will you be.
-----

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

message: 5
date: Wed, 20 Jul 2005 10:24:37 +0200
from: a.perquin@xxxxxxxxxxxxx
subject: Passing parms in a submitted call from a RPG programm

Hello all,

I hope there's anybody who can help me with the challenge. Picture this:

*========================================================================= 

* (Externe) Prototype Definitions 
*=========================================================================
  // Submit clear  
D QCmdExc         PR                  ExtPgm('QCMDEXC')  
D  cmdString                    90A   Const Options(*VarSize)  
D  cmdLen                       15P 5 Const 

*========================================================================= 
 
* Variabele declaration  
*========================================================================= 
 
D cmdString       S             90A 
D cmdLen          S             15P 5 
D pressNum        S              2A   Inz(*Blanks) 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main processing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
*=========================================================================
* SrA999 Clear Optalex_Tx file with a submit 
*=========================================================================
C     SrA999        BegSr 
   /Free  
    pressNum=%subSt(trgBufIn.file : 5: 2); 

    cmdString='SBMJOB CMD(CALL PGM(*LIBL/POXTX0CL) PARM(pressNum))'; 

    CallP QCmdExc(cmdString: %Len(cmdString));
/End-Free 
C                   EndSr 
****************** End of data 
********************************************

When I catch the matching variable in the CL program POXTX0CL the value = 
'pr". If tried the pass the value hard coded as e.g. '07', but when 
compiling the compiler gives a "*RNF5377 20      1 The end of the 
expression is expected. " on the quotation marks. Changing the data type 
to numeric has also no influence, the received value is blanks en the 
program comes back wit a decimal data error. The only thing I haven't 
tried is a compile time array with completely valued command strings, but 
I don't think that that's the solution for this problem.

I'll want to thank everybody in advance for thinking with me.
Armand  
_____________________________________
H.P.J. Perquin
Ontwikkelaar AS/400

Boal Beheer B.V.
De Hondert Margen 12
2678 AC  De Lier
Tel. +31 (0)174 527297 
Fax +31 (0)174 527264
E-mail: a.perquin@xxxxxxxxxxxxx
Internet: http://www.boalgroup.com


Panieklijn
Tel. +31 (0)612854010

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

message: 6
date: Wed, 20 Jul 2005 18:58:32 +0800
from: "Ma?oso, Carl" <ManosoCS@xxxxxxxxxxxxxxxxx>
subject: RE: *** ADMIN: Code repository

Ron,

Try using web-to-email services like:

www4mail (at) wm.ictp.trieste.it
agora (at) dna.affrc.go.jp
text (at) pagegetter.com

It's been a while since I last used them so I already forgot the commands to
use in these services. But you can send an email message to them with the
subject "help" and just to make sure put "help" (w/o the quotes) in the body
as well. The services are free and have a quota and sometimes the response
time is too slow.

www.pagegetter.com also offers paid services if the quota is too small for
your use. The only problem is if your network gods also have these email
addresses black-listed. Then all hope is lost.

--
Carl Maoso
"It is not real work unless you would rather be doing something else."
[J.M.BARRIE]




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

message: 7
date: Wed, 20 Jul 2005 11:43:55 +0200
from: a.perquin@xxxxxxxxxxxxx
subject: Passing parms in a submitted call from a RPG programm

Hello,

Can you please cancel my question. I found the solution so there's no need 
to put any afford in it.

The problem was in the declaration of a field and the building of the 
command string.

D cmdString       S             90A   Varying 

cmdString='SBMJOB CMD(CALL PGM(*LIBL/POXTX0CL) PARM('''+pressNum+'''))';

Thanks for all the time and trouble,

Best regards

Armand
_____________________________________
H.P.J. Perquin
Ontwikkelaar AS/400

Boal Beheer B.V.
De Hondert Margen 12
2678 AC  De Lier
Tel. +31 (0)174 527297 
Fax +31 (0)174 527264
E-mail: a.perquin@xxxxxxxxxxxxx
Internet: http://www.boalgroup.com


Panieklijn
Tel. +31 (0)612854010

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

message: 8
date: Tue, 19 Jul 2005 15:37:44 -0500
from: "John" <jking@xxxxxxxxxxx>
subject: RE: POI/HSSF default cell formatting

Peter,

 Have you seen Scott Klement's article on parsing Excel sheets in the Jan
2004 iSeries Network newsletter?
http://www.iseriesnetwork.com/resources/artarchive/index.cfm?fuseaction=view
article&CO_ContentID=17839&channel=art&subart=issue&issueid=917

 Although the actual techniques are beyond my ken, conceptually it seems
that one could extends Scott's 'ParseSheetListener.java' program to also
monitor for the 'ColumnInfoRecord's. For each record returned, use
getXFIndex to retrieve the ExtendedFormatRecord that contains all the juicy
bits. Use that data to populate the array in your RPG program. Ugh.

 The larger question in my mind is how to ensure that the ColumnInfoRecord
is accurate for the entire column. My understanding is that this record
contains the column's defaults - which could be entirely different than how
the data in the body of the sheet is formatted. Assuming the sheet already
has some data, perhaps it would be safer to search out the last populated
row, clone it and overwrite the data?

Good luck, JK

-----Original Messa
date: Tue, 19 Jul 2005 10:34:30 -0700
from: "Peter Dow \(ML\)" <maillist@xxxxxxxxxxxxxxx>
subject: RE: POI/HSSF default cell formatting

Hi Leif,

Thanks, I've done that too (thanks Scott!) when I'm in control of the
formatting.  In this case however, I'm reading an existing spreadsheet where
a user has set up some formatting and I have no idea what it might be, it's
done in Excel by selecting the columns then doing ctl-1 (or going to the
Format, Cell menu).  Since the rows and cells have not been created yet, I
can't extract any existing HSSFCellStyle object from them.  The information
appears to be in ColumnInfo records in the spreadsheet, and the HSSF
usermodel doesn't have any classes or methods to extract those records or
get the formatting.  Nor have I seen anything on the jakarta website that
does.  I think I may be in the "to do" section of the project...

Peter Dow
Dow Software Services, Inc.
www.dowsoftware.com
909 793-9050 voice
909 793-4480 fax



-----Original Message-----
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Leif Guldbrand
Sent: Tuesday, July 19, 2005 6:30 AM

I'll try to show what I have done, formatting new cells.
I have five different formats and the standard format for cells.
I have used Scott Klements articles and examples - and his help to do it :-)





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


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.