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



Hi Scott,

Sorry for not explaining what I wanted.

We are expecting around one million orders a day, now some how on daily
basis we need to archive this data and be able to use it as needed.  

Our thinking is that we will store the lookup data in regular file layout
(index file), which will be used to search records but rest of the data will
be in compress format or files.  User can search the records using Index
file and then we can uncompress the required data and use it.  

I can easily do it on PC platform but wondering if there is any utility or
functionality within OS/400 which can help us to do what we are trying to
do.  Meaning save the disk space by compressing it and also be able to
recover data from compress mode within seconds.

Any idea how to solve this issue?  It's all regular data (numbers/strings).
For one order we have 100s of files and there are 100s of fields in each one
of them.  Don't ask why we have so many files and fields.  (FYI: It's all
custom development of many years). We would like to compress this data by
order number so that we can easily retrieve it.

Thanks




Today's Topics:

   1. Re: User Profile Retrieval (Scott Klement)
   2. Re: How to compress data in RPGLE and save it in a file and
      restore i t as needed?  (Scott Klement)
   3. Re: Initialization of static variables (Joep  Beckeringh)
   4. RE: Initialization of static variables (Joe Pluta)
   5. RE: How to compress data in RPGLE and save it in a file and
      restore   it as needed? (Bob cozzi)
   6. RE: Initialization of static variables (Bob cozzi)
   7. RE: Initialization of static variables (Joe Pluta)
   8. RE: Initialization of static variables (Bob cozzi)
   9. Re: Initialization of static variables (Carsten Flensburg)


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

message: 1
date: Tue, 30 Dec 2003 16:12:42 -0600 (CST)
from: Scott Klement <klemscot@xxxxxxxxxxxx>
subject: Re: User Profile Retrieval



> My question is this:  I would like to retrieve the name of the user
profile
> that is running the current program.  I know that in CL, you simply use
the
> RTVUSRSPC command, and I am also aware that I can run this command using
the
> QCMDEXC API, but I don't believe this would place the results in an RPG
> variable, in fact, I doubt it would even run (would it?).
>

No, it would not run.  Generally QCMDEXC only works for commands that you
can run from the command-line.


>
> Is there an API to retrieve the user profile within an RPGIV Program?
>

Rather than ask a question like "Is there an API to xxxxxx" please take
the time to look in the Information center first.

1) go to http://www.iseries.ibm.com/infocenter
    (remember that URL, it's easy to remember)

2) After selecting your region & release, you'll get the Information
     Center.

3) In the navigation bar on the left select "Programming" then
     "APIs" then "API finder"  (in V5R2...  the process may vary
      slightly for older releases)

4) Under "Search by Descriptive Name" type "Retrieve User" then click
      GO!

Alternately:

4)  Select APIs by category.  Select the category you're interested in.
      (in this case "Security APIs") then select the API from the list.

The reason I'm explaining this is that you won't have to ask about every
API, you can just look them up.  That saves the rest of us having to look
them up for you.


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

message: 2
date: Tue, 30 Dec 2003 16:16:37 -0600 (CST)
from: Scott Klement <klemscot@xxxxxxxxxxxx>
subject: Re: How to compress data in RPGLE and save it in a file and
        restore i t as needed? 


Can you give us a little more detail on what you're trying to do?  Do you
have data in a field that you're trying to compress into a smaller field?
Or are you trying to zip up a stream file?  Or compress an OS/400 object?
or...?

Are you wanting to write your own compression routines?  Or run a command
that compresses an object?  or a data stream to save time while
transfering over a communications device?

Do you need a particular type of compression?  Like, do you need to be
compatible with GIF image format?  or .ZIP files?  or...?


On Tue, 30 Dec 2003, Tanveer, Mohammad wrote:
>
> How to compress data in RPGLE and save it in a file and restore it as
> needed? Any suggestion / answer will be greatly appreciated.
>


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

message: 3
date: Tue, 30 Dec 2003 23:55:41 +0100
from: "Joep  Beckeringh" <joep.beckeringh@xxxxxxxxxx>
subject: Re: Initialization of static variables

Joe,

Most obvious solution would be to clean up when you leave. Perform special
calls that make the procedures initialize the static variables when you
leave the program with LR on.

Joep Beckeringh


----- Original Message -----
From: "Joe Pluta" <joepluta@xxxxxxxxxxxxxxxxx>
To: "'RPG programming on the AS400 / iSeries'" <rpg400-l@xxxxxxxxxxxx>
Sent: Tuesday, December 30, 2003 5:39 PM
Subject: Initialization of static variables


> (AGH!  I reposted this because I forgot to change the subject.)
>
>
> I was trying to figure out why static variables in a subprocedure are
> not being reinitialized when I reenter the program.
>
> Being a good boy, I did a little research and found Barbara's answer
> from two years ago, which as always is clear and complete.
> Unfortunately, it's very frustrating, because it's not what I want to
> hear <grin>.
>
> "I think what you're suggesting is that when a _module_'s (not program)
> main procedure returns with LR on, when that main procedure gets called
> again, the subprocedure static should get reinitialized along with the
> other globals in the module.  Maybe that would have been the right
> behaviour, maybe not.  What about calls to the subprocedures between
> calls to the main procedure?  Should the subprocedures be reinitialized
> even before the main procedure gets called again?
>
> As to whether this is right or wrong, maybe it would have been better to
> have different behaviour for subprocedures in a module with a main.
> Maybe the subprocedures' static should have been subject to LR
> reinitialization. Or at least non-exported subprocedures.  But then
> there would have been different behaviour for a subprocedure in a NOMAIN
> module.  Our thinking was that subprocedures are more ILE-ish than
> RPG-ish, and should behave like ILE things, and not be subject to the
> RPG cycle."
>
>
> Okay, I can buy this.  It simply means that anything I want
> reinitialized whenever the program restarts has to be global.  Pluses
> and minuses there, but it's at least a workaround.
>
> I would ask for one thing.  I would love a keyword either on the D spec
> (or even up at the PI level) along the lines of *GLBREINZ that would say
> "reinitialize this variable whenever global reinitialization is done".
> That would allow us the best of both worlds.
>
> Joe



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

message: 4
date: Tue, 30 Dec 2003 18:37:35 -0600
from: "Joe Pluta" <joepluta@xxxxxxxxxxxxxxxxx>
subject: RE: Initialization of static variables

> From: Joep Beckeringh
> 
> Most obvious solution would be to clean up when you leave. Perform
special
> calls that make the procedures initialize the static variables when
you
> leave the program with LR on.

Actually, Joep, the most "obvious" solution would be to make calls to
the procedure to initialize the variables when I enter the program, in
*INZSR.  This is doable, but it's really a pain in the butt.  When I'm
absolutely forced to do this, I simply set all my parameters to *NOPASS
and then execute the procedure with no parameters.  But it would be a
LOT easier to let the machine handle it.

The fact that procedures are in some ways different from RPG doesn't
mean that you should have to choose between one way of action and
another.  By specifying a keyword either at the procedure interface or
the d-spec level you would have fine-grained control over the actions of
the runtime, and you wouldn't have to code dozens of little what are in
effect "procedure initialization" routines.

And it's not necessary to tie it to the cycle; I think Booth's
suggestion of a RESET *GLOBAL command would actually be very powerful.
Or maybe RESET *LOCAL to reset just local static variables.

Joe



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

message: 5
date: Tue, 30 Dec 2003 19:09:15 -0600
from: "Bob cozzi" <cozzi@xxxxxxxxx>
subject: RE: How to compress data in RPGLE and save it in a file and
        restore it as needed?

There are two MI instructions that compress and decompress data in a field.
They are really meant for long fields; since a "header" is inserted into the
field's compressed data you could end up with a longer field value than you
started with.


Bob Cozzi
Cozzi Consulting
www.rpgiv.com


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Tanveer, Mohammad
Sent: Tuesday, December 30, 2003 2:57 PM
To: 'rpg400-l@xxxxxxxxxxxx'
Subject: How to compress data in RPGLE and save it in a file and restore it
as needed? 

How to compress data in RPGLE and save it in a file and restore it as
needed? Any suggestion / answer will be greatly appreciated.


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





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

message: 6
date: Tue, 30 Dec 2003 19:21:43 -0600
from: "Bob cozzi" <cozzi@xxxxxxxxx>
subject: RE: Initialization of static variables

Joe,
Why on Earth would you call a module?
That is the strangest design decision I have seen on this ILE architecture
(not your's specifically just in general).
I mean if you have:
  CALLP  'MYMODULE'

What is the benefit? 


Bob Cozzi
Cozzi Consulting
www.rpgiv.com


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Joe Pluta
Sent: Tuesday, December 30, 2003 10:39 AM
To: 'RPG programming on the AS400 / iSeries'
Subject: Initialization of static variables

(AGH!  I reposted this because I forgot to change the subject.)


I was trying to figure out why static variables in a subprocedure are
not being reinitialized when I reenter the program.

Being a good boy, I did a little research and found Barbara's answer
from two years ago, which as always is clear and complete.
Unfortunately, it's very frustrating, because it's not what I want to
hear <grin>.

"I think what you're suggesting is that when a _module_'s (not program)
main procedure returns with LR on, when that main procedure gets called
again, the subprocedure static should get reinitialized along with the
other globals in the module.  Maybe that would have been the right
behaviour, maybe not.  What about calls to the subprocedures between
calls to the main procedure?  Should the subprocedures be reinitialized
even before the main procedure gets called again?

As to whether this is right or wrong, maybe it would have been better to
have different behaviour for subprocedures in a module with a main.
Maybe the subprocedures' static should have been subject to LR
reinitialization. Or at least non-exported subprocedures.  But then
there would have been different behaviour for a subprocedure in a NOMAIN
module.  Our thinking was that subprocedures are more ILE-ish than
RPG-ish, and should behave like ILE things, and not be subject to the
RPG cycle."


Okay, I can buy this.  It simply means that anything I want
reinitialized whenever the program restarts has to be global.  Pluses
and minuses there, but it's at least a workaround.

I would ask for one thing.  I would love a keyword either on the D spec
(or even up at the PI level) along the lines of *GLBREINZ that would say
"reinitialize this variable whenever global reinitialization is done".
That would allow us the best of both worlds.

Joe

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





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

message: 7
date: Tue, 30 Dec 2003 19:57:40 -0600
from: "Joe Pluta" <joepluta@xxxxxxxxxxxxxxxxx>
subject: RE: Initialization of static variables

> From: Bob cozzi
> 
> Joe,
> Why on Earth would you call a module?
> That is the strangest design decision I have seen on this ILE
architecture
> (not your's specifically just in general).
> I mean if you have:
>   CALLP  'MYMODULE'

Um.  Who said I was calling a module, Bob?

Basically, I'm using procedures within a program with a MAIN.  These
procedures perform tasks that require the preservation of data between
calls (static data).  While I can do this using global variables, I'd
rather this data not be visible outside the scope of the procedure, thus
I'd like to use local variables.

So, the obvious choice is to use local static variables with an
initializer.

The problem is that I would like these variables reinitialized each time
the program is called, but they are not (even if the program is bound
with ACTGRP(*NEW)!).  Thus, I have to manually reinitialize the
variables.  And since the data is local to the procedure, I must call
the procedure to initialize the data.  To date, I have done this by
passing no parameters to the procedure.  (This of course only works if
the procedure normally requires parameters.)

I'm not sure where you got "calling a module" from, except maybe by
reading between the lines I quoted of Barbara's explanation.

Joe



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

message: 8
date: Tue, 30 Dec 2003 21:06:57 -0600
from: "Bob cozzi" <cozzi@xxxxxxxxx>
subject: RE: Initialization of static variables

Sorry... you're right I misread what you stated.


Bob Cozzi
Cozzi Consulting
www.rpgiv.com

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Joe Pluta
Sent: Tuesday, December 30, 2003 7:58 PM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: Initialization of static variables

> From: Bob cozzi
> 
> Joe,
> Why on Earth would you call a module?
> That is the strangest design decision I have seen on this ILE
architecture
> (not your's specifically just in general).
> I mean if you have:
>   CALLP  'MYMODULE'

Um.  Who said I was calling a module, Bob?

Basically, I'm using procedures within a program with a MAIN.  These
procedures perform tasks that require the preservation of data between
calls (static data).  While I can do this using global variables, I'd
rather this data not be visible outside the scope of the procedure, thus
I'd like to use local variables.

So, the obvious choice is to use local static variables with an
initializer.

The problem is that I would like these variables reinitialized each time
the program is called, but they are not (even if the program is bound
with ACTGRP(*NEW)!).  Thus, I have to manually reinitialize the
variables.  And since the data is local to the procedure, I must call
the procedure to initialize the data.  To date, I have done this by
passing no parameters to the procedure.  (This of course only works if
the procedure normally requires parameters.)

I'm not sure where you got "calling a module" from, except maybe by
reading between the lines I quoted of Barbara's explanation.

Joe

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




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

message: 9
date: Wed, 31 Dec 2003 11:33:48 +0100
from: "Carsten Flensburg" <flensburg@xxxxxxxxxx>
subject: Re: Initialization of static variables

Hello Joe,

> The problem is that I would like these variables reinitialized each time
> the program is called, but they are not (even if the program is bound
> with ACTGRP(*NEW)!).

- If the activation group that the program is running in is destroyed - and
that's the case when activation group *NEW is specified and the program
terminates - the storage that the static variables occupies is reclaimed.
And likewise, when the program is called again, a new, unique activation
group is created and the program's static storage is initialized.

This is why it is possible to call programs running in *NEW activation
groups recursively - all otherwise conflicting resourses are scoped to
individual, non-persistent activation groups that are destroyed when control
is returned to it's caller (regardless of LR setting).

- So your ACTGRP(*NEW) approach actually should work - that would also make
sense in regard to Barbara's statement about ILE-ish behaviour being
preferred over RPG-ish ditto when designing this aspect of the RPG/IV
runtime. How did you test the ACTGRP(*NEW) setting?

Best regards,
Carsten Flensburg



###########################################
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/


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

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



End of RPG400-L Digest, Vol 2, Issue 1003
*****************************************

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.