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



Ken,

More specifically, I want to know if I can retrieve information from a data 
area (at prompt time) to fill in defaults into a parameter.  Also, if the 
defaults on that parameter are changed, update the data area so that those 
values are available next time the command is executed.

Thanks,
  Ted

>>> KSIMS@SOUTHERNWINE.com 08/14/01 09:24AM >>>
Hi Ted -

>>> Is PARM a data area name . . . . DTAARA         *YES
>>
>>The DTAARA keyword, along with PGM and FILE, is only for 
>>cross-referencing information.  Anything you want to do 
>>with the data area specified on the command you must do 
>>in your command processing program.
>
>Exactly!  I'm familiar with how this works, but have never 
>seen it done.  I've never done it myself and was wondering 
>if anyone out there had a good example they could share with 
>us as to how it's done.

Okay, here is an example using FILE.  I have a command called CRTDUPFSET
(Create Duplicate File Set).  Its function is to create a duplicate of a
physical file and its associated logical files into another library.

In the command source, the parameter for the original file looks like this:

            PARM       KWD(FILE) TYPE(FILE) MIN(1) FILE(*UNSPFD) +
                         PROMPT('File')
FILE:       QUAL       TYPE(*NAME) LEN(10) MIN(1)
            QUAL       TYPE(*NAME) LEN(10) DFT(*LIBL) +
                         SPCVAL((*LIBL) (*CURLIB)) PROMPT('Library')

Note the FILE(*UNSPFD) on the PARM statement.  That means that this
parameter is a file name of "Unspecified" usage.

In a particular CL program I have the command  CRTDUPFSET OR5200TF

When I do DSPPGMREF against that CL program, among other things I see:

Object  . . . . . . . . . . . . . . . . . . :     OR5200TF
  Library . . . . . . . . . . . . . . . . . :       *LIBL
  Object type . . . . . . . . . . . . . . . :       *FILE
  File name in program  . . . . . . . . . . :       OR5200TF
  File usage  . . . . . . . . . . . . . . . :       Unspecified

Without FILE(*IN/*OUT/*UPD/*INOUT/*UNSPFD) on the PARM statement, I would
not see the reference to the file.

It is up to the person creating the command source to make sure that any
PGM/DTAARA/FILE cross-referencing information is correct.  If I had put
DTAARA(*YES) instead of FILE(*UNSPFD) in my CRTDUPFSET command, then
DSPPGMREF for the CL program using CRTDUPFSET OR5200TF command would show
that the program uses data area OR5200TF.

Ken
Southern Wine and Spirits of Nevada, Inc.
Opinions expressed are my own and do not necessarily represent the views of
my employer or anyone in their right mind.

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com 
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l 
or email: RPG400-L-request@midrange.com 




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.