HP3000-L Archives

May 2001, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Karsten Holland <[log in to unmask]>
Reply To:
[log in to unmask][log in to unmask] Therm-O-Link, Inc.
Phone: 330-527-2124 P. O. Box 285
Fax: 330-527-2123 10513 Freedom Street
Web: http://www.tolwire.com Garrettsville, OH 44231 [...]49_17May200109:23:[log in to unmask]
Date:
Mon, 21 May 2001 11:12:06 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (157 lines)
I often have a need to do this, so I wrote a MPEiX command that allows me to
write a job stream that requests PARMS. For security sake the command always
builds a job-card based on the user running it, (and MPEiX will request that
users password when BATCH executes the STREAM command). Put this file in
your command-path, create a job stream without a job-card. Use "%%" at the
begining of a line to have that line substituted, or "$$" to have that line
executed as in the examples that follow:

parm jobname
comment BATCH (job stream submition),
comment reads through a job file substituting %%,
comment user is prompted with remainder of line.
comment tmp01 is the read file, tmp02 is the stream file.
purge t00tmp01                       >$NULL
purge t00tmp01,temp                  >$NULL
file t00tmp01;rec=80,,f,ascii;msg;temp
purge t00tmp02                       >$NULL
purge t00tmp02,temp                  >$NULL
print !JOBNAME,*t00tmp01
if POS(".","!JOBNAME")>1 THEN
  comment cleaning up jobname for inclusion in the JOB CARD
  setvar _jobname,lft("!JOBNAME",POS(".","!JOBNAME")-1)+","
else
  setvar _jobname,"!JOBNAME,"
endif
setvar job_card,chr(124)+"JOB
"+_jobname+hpuser+"."+hpaccount+";outclass=22,8"
echo !job_card>>t00tmp02
while FINFO("T00TMP01",19)>0 do
  input job_record<t00tmp01
  setvar job_record,RTRIM(job_record," ")
  IF LFT(job_record,2)="%%" THEN
    setvar pprompt,RTRIM(job_record-"%%"," ")
    setvar user_resp," "
    input user_resp;prompt="!pprompt"
    echo !user_resp>>t00tmp02
  elseIF LFT(job_record,2)="$$" THEN
  comment if $$ is used, execute the job_record.
    setvar pprompt,RTRIM(job_record-"$$"," ")
    !pprompt
  elseIF LFT(job_record,1)=chr(33) THEN
    comment strip the exclamation, insert a bar.
    setvar job_record,"|"+RHT(job_record,LEN(job_record)-1)
    echo !job_record>>t00tmp02
  elseIF LFT(job_record,2)=(" "+chr(33)) THEN
    setvar job_record,RHT(job_record,LEN(job_record)-1)
    echo !job_record>>t00tmp02
  else
    echo !job_record>>t00tmp02
  endif
endwhile
setvar stream_date,""
setvar stream_time,""
echo
input stream_date;prompt="(!HPMONTH/!HPDATE/!HPYYYY) STREAM DATE?"
input stream_time;prompt="(!HPHOUR:!HPMINUTE) STREAM TIME?"
if stream_date<>"" then
 setvar stream_date,";DATE="+stream_date
endif
if stream_time<>"" then
 setvar stream_time,";AT="+stream_time
endif
STREAM t00tmp02,| !stream_date!stream_time
comment note: if the job contains line with exclamations in
comment        a column other than 1, BATCH will try and replace
comment       values for those variables. Use double exclamations.
PAUSE 1
COMMENT *END OF BATCH COMMAND*


Below is a sample job; the lines with $$ are executed immediately by the
BATCH command. Note that the variables set by those commands are then used
in the following lines with exclamations, you must use exclamations to pull
in the value, the variables will not exist in your job (they are just in the
session executing the BATCH command).

!comment JOB used in conjunction with 'BATCH' command file
!comment see file JTXSLMN
$$INPUT YYMMDD;prompt=" Date YYMMDD?"
!file TXSLMN=TX!YYMMDD.SAVE
$$INPUT SLMN_NO;prompt=" Salesman Number?"
!sup
in *TXSLMN
DEF SLMN,10,3
DEF REC,1,80
IF SLMN="!SLMN_NO"
EXT REC
LIST STANDARD
X
EXIT
!TELL !HPJOBNAME,!HPUSER.!HPACCOUNT;JTXSLMN FINISHED|
!eoj

Here is another example, that uses direct substitution into the job-stream.
The BATCH command looks for "%%" in the first column and prompts the user
with the line, then it substutes what the user typed into the job.

!comment JOB used in conjunction with 'BATCH' command file
!comment see file JEFTPYRT.KARS
!sup
ba xxdb.xx,1,xxx
GET INV-DTL
DEF IK,INV-KEY[5],6
IF IK=&
%%Invoice-No(X8) in quotes with Leading Zeroes?
LIST
X
DO GET
DO IF
UPDATE
EXT PAY-CHAIN=&
%%PAY-CHAIN(I1) w/ no quotes ?
EXT PAY-ROUTING=&
%%PAY-ROUTING(I1) w/ no quotes ?
X
DO GET
DO IF
LIST
X
EXIT
!TELL !HPJOBNAME,!HPUSER.!HPACCOUNT;JEFTPYRT FINISHED|
!eoj


This is what I use to accomplish the functionality you are looking for. I
hope it helps.

Karsten Holland
MIS Site Manager
NWS Corp. Chicago
(800)685-6868 (X8022)
[log in to unmask]



-----Original Message-----
From: Born, Ken [mailto:[log in to unmask]]
Sent: Thursday, May 10, 2001 10:21 AM
To: [log in to unmask]
Subject: [HP3000-L] Passing Parameters to Stream Jobs


I can't find any JCL's on our system that allows a parameter or info string
to be passed.  I looked at the STREAM and JOB commands and can't find a way
to do this.  I want to do something like STREAM TESTJCL;info="THIS IS A
TEST"

Can this be done?

Thanks....

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2