Joined: 03 Dec 2002 Posts: 114 Topics: 0 Location: Sydney, Australia
Posted: Tue Oct 28, 2003 4:11 pm Post subject:
It looks, not that I have used focus, that you need to have the record with SET PASS=myuserid included in the data that will read via DDNAME QQREPQQ
so perhaps something like this might work :-
Code:
/* Rexx - PROB0028 */
rptdsn = "DMI021.FOCUSPW.RPT" /*--- used for testing ---*/
myidds = userid()".FOCUSPW.T"time("S")
pwstmnt.1 = Left("SET PASS="userid(),80)
x = outtrap(x.,"*")
"DELETE '"myidds"'"
"ALLOC F(MYPW) DA('"myidds"') RECFM(F B) SPACE(1,1) CYL LRECL(80) ",
" NEW CATALOG"
"EXECIO 1 DISKW MYPW (STEM pwstmnt. FINIS"
"FREE F(MYPW)"
x = outtrap("OFF")
/*------------------------------------------------------------------*/
/* the rest of your allocations etc go here, obviously not as */
/* comments, here's QQREPQQ */
/*------------------------------------------------------------------*/
"ALLOC F(QQREPQQ) DA('"myidds"','"rptdsn"') SHR REUSE"
/* invoke focus etc here then when done free the allocations */
"FREE F(QQREPQQ)"
/*------------------------------------------------------------------*/
/* Then you may wish to delete the the dataset */
/*------------------------------------------------------------------*/
x = outtrap(x.,"*")
"DELETE '"myidds"'"
x = outtrap("OFF")
I've included a few comments that might assist.
Basically it generates a dataset name, that includes userid of the person running it as the HLQ, FOCUSPW as the 2nd qualifier and Tnnnnn as the third qualifier (where nnnnn is the number of seconds since midnight, thus generating a relatively unique dataset name).
Next an attempt is made to delete the dataset (this should not exist, but hust in case).
This dataset is then created and allocated to the ddname MYPW (you might have to play around with the alloc statement, depending upon how your site is setup and the requirements of the FOCUS QQREPQQ ddname (I'm pretty sure a record length of 80 will be OK though).
A single record is written (this being generated previously and stored in the variable PWSTMNT.1) via the EXECIO statement.
The dataset is then FREED from the ddname MYPW.
The dataset, that now contains the appropriate data (I hope), and the report dataset name (note I've used a test dataset, it's name being held in the rptdsn variable and set in the 3rd statement). They are concatenated in the correct order (i.e. the dataset with the SET PASS=??? statement being processed first).
You would then do you other allocations and then invoke FOCUS.
After the report has been run, it would be prudent to free all the ddnames (I've show 1 statement freeing the datasets allocated to ddname QQREPQQ ).
It would also be prudent to then delete the dataset containing the SET PASS=??? statement. Again I have included this.
You will notice two pairs of Outtrap statements, these are used to suppress the messages that you probbaly wouldn't want the user to see.
I hope this helps you to resolve your problem. _________________ Regards,
Mike.
1. thanks for your help ..here is what I found another way of doing the same
===========================
Instead of
//REPDD DD *
SET Pass=userid
// DD dsnname
//SYSIN DD *
EX REPDD
/*
have decided
//REPDD DD dsnname
//SYSIN DD *
SET Pass=userid
EX REPDD
so after my "Alloc DD(SYSIN) DS(*)" stmt , have included
Queue 'SET PASS='Userid()
Do Queued(); pull;End
It worked perfectly
==========================
2. I have another problem now ...
I have FOCUS reports stored in various members of PDS.
I want to
a. Read a requested report DYNAMICALLY ( xyz.aaa.bbb(test) )
b. Store it in some intermediate place like Queue or something else
c. Read the QUEUE one by one and include that report in
SYSIN DD * statement of enclosed JCL which will get submitted ultimately
d. Check if you get a statement named END
e. Just before that statement , I want to include another FOCUS command
ON TABLE SAVE AS 'userprovided name'
f. Write END statement as it is after that
g. As informed earlier , include modified report as SYSIN DD * or with any other DDNAME say
//REPORT1 DD *
modified report
Here is what I thought as of NOW
Address TSO "Alloc DD(ddname) DS(dsname) SHR REUSE"
Address TSO "EXECIO * DISK SYSIN (FINIS"
Do Queued(); pull ; End
This will put in a Queue . Now I wanted to read that Queue and search for END statement....
Joined: 03 Dec 2002 Posts: 114 Topics: 0 Location: Sydney, Australia
Posted: Sun Nov 02, 2003 5:23 pm Post subject:
Personally, if I understand your question correctly, I'd do something like this (note I prefer reading/writing from stem variables rather than using the stack (not sure if there's really any real advantage/disadvantage with either method), so I am more comfortable providing examples that utilise them):-
/* Loop through the input writing each record to the internal reader */
/* If a record contains an END STATEMENT (END with space either side) Then add a record prior to the END statement */
Do Forever
"EXECIO 1 DISKR SYSIN (STEM in. "
If Rc _________________ Regards,
Mike.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum