Passing Parms to CL

Latimer, Richard richard.latimer@airways.co.nz
Thu, 24 Aug 2000 09:07:52 +1200


George,

Every user or batch process on an AS400 has it's own QTEMP library. From a
programmers perspective they are called QTEMP but there "real" name is
something like "qtemp<userID>". They disappear all by themselves when the
user or process ends their session, and  you also cannot see someone else's
QTEMP.

Given this you cannot use QTEMP as the area to store your passed parameters.

The issue for you is where you write the 'use' files and making sure that
your batch process will find them. 

Writing:
OS400 maintains a library list (roughly equivalent to the DOS 'path') and
one library in that list will be the "current library".  If the user has
their own library, named identically to their user profile, this will become
the default "curlib". If a library with the same name as the user profile
doesn't exist "curlib" will default to QGPL. Disk files and permanent
subfiles will be placed in one of these  current libraries.  (Note that you
can force a different library in the user profiles or by using "chgurlib
xxxxx" in a login script or CL program)

Reading:
Following on from the above OS400 searches the library list  (starting at
the current library) for the requested file. 

Complication:
There are 2 ways of submitting jobs on the AS400 - 
Submit Job "SBMJOB" ,  Submit Database Job  "SBMDBJOB"

The significant difference between them is that the the "sbmjob" inherits
the library list and current library of the user that submitted it. The
"sbmdbjob" gets a library list from a (nominated) job description.


Suggestion:
Create default libraries for each of your users and allow these to be their
current libaries (this shouldn't  conflict with JDE practice . . .)
Do not 'force' the creation of the 'use' files but allow them to go to the
default curlib
Use 'sbmjob' to run your reports.

cheers
Richard


> -----Original Message-----
> From:	george.j.wen@us.abb.com [SMTP:george.j.wen@us.abb.com]
> Sent:	Thursday, August 24, 2000 7:07 AM
> To:	'powerh-l@list.swau.edu'
> Subject:	Passing Parms to CL
> 
> 
> 
> Hello all in PH land,
> 
> This is a PH-AS/400 question.  There's not a whole lot in the manuals
> about using PH in batch.  I'm hoping someone has experience here.
> I'm passing parameters via the creation of a disc file.  A screen calls
> a CL that executes a Quiz programs that prompts the user for some,
> let's say dates for sake of example.  I don't want to run the report
> interactively so I submit another CL to batch.  This 2nd CL runs the
> Quiz report.  The Quiz report does a "Use" to the disc file to get the
> dates (i.e. select statement).
> 
> This all works fine provided I don't put the disc file in the QTEMP
> directory.  The batch job uses a different QTEMP (or session in my
> mind) than the user used when he/she created the disc file hence it
> can't be found by the Quiz program in the batch process.  We'd like
> to use QTEMP for the very reason that it is temporary.  This would
> be the security blanket we need to prevent 2 users from simultaneously
> trying to use the disc file with a 2nd user possibly over-writing the file
> of the 1st user before the batch job has had a change to run.  This is
> currently a possibility as we put the disc files in library ABBPHSRC.
> Is there a way for us to be able to use QTEMP in the batch job??
> If not maybe we could name the disc file with a user name or time
> stamp, but then how would the Quiz program in the batch job know
> the disc file name?  Is there a way to pass this?  Or is there a better
> way entirely for handling prompting and parameter entry with PH on
> the AS/400?
> 
> I hope this is clear.
> Here's a kind of outline for clarity:
> 
>      Menu - Calls Job1
>                    Job1 executes Quiz Prog1 (interactive)
>                            Quiz Prog1 prompts the user for dates
>                          and writes a Disc File with a select
>                          statement.
>                   Job1 submits Job2 to Batch
>                   Job2 executes Quiz Prog2 which is the report.
>                                                                       Quiz
> Prog2
> 'Uses' the Disc File
> 
> Thanks,
> 
> George W (not running for Pres.
> 
> 
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> =
> Subscribe: "subscribe powerh-l" in message body to
> majordomo@lists.swau.edu
> Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
> This list is closed, thus to post to the list, you must be a subscriber.

######################################################################
This electronic message together with any attachments is confidential.
If you receive it in error: (i) you must not use, disclose, copy or
retain it; (ii) please contact the sender immediately by reply email
and then delete the emails. Views expressed in this email may not be
those of the Airways Corporation of New Zealand Limited
######################################################################
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.