View previous topic :: View next topic
|
Author |
Message |
satheeshkamal
New User
Joined: 09 Jan 2007 Posts: 28 Location: Chennai
|
|
|
|
Guys,
I am using the following code snippet.
/
Code: |
*****REXX************************************************************/
PARSE UPPER ARG INPUT_DSN OUTPUT_DSN
/*********************************************************************/
/* VALIDATE INPUT PARAMETERS */
/*********************************************************************/
IF INPUT_DSN = '' THEN
DO
SAY 'INPUT DATASET SHOULD NOT BE NULL'
EXIT 0
END
IF SYSDSN(INPUT_DSN) \= 'OK' THEN
DO
SAY 'INPUT DATASET NOT FOUND'
EXIT 0
END
DO WHILE OUTPUT_DSN = ''
SAY 'ENTER OUTPUT DATASET WITHOUT QUOTES'
PULL OUTPUT_DSN
END
OUTPUT_DSN = "'" || STRIP(OUTPUT_DSN) || "'"
IF SYSDSN(OUTPUT_DSN) = 'OK' THEN
DO
ZEDSMSG = 'OUTPUT DATASET EXIST !!'
"ISPEXEC SETMSG MSG(ISRZ001)"
EXIT 1
END
"ALLOCATE DA("OUTPUT_DSN") LIKE("INPUT_DSN")"
IF RC > 0 THEN
DO
SAY 'CHECK NAME OF THE DATASET !!!!!!!!!!'
EXIT 0
END
SAY 'COPYING IS IN PROGRESS ......'
"ALLOC DA("INPUT_DSN") F(SYSUT1) SHR REUSE"
"ALLOC DA("OUTPUT_DSN") F(SYSUT2) SHR REUSE"
FC = LISTDSI(INPUT_DSN)
IF SUBSTR(SYSDSORG,1,2) = 'PO' THEN
DO
"ALLOC F(SYSPRINT) DUMMY"
"CALL *(IEBCOPY) "
"FREE F(SYSPRINT)"
END
"FREE F(SYSUT1,SYSUT2)"
SAY 'DATASET ALLOCATED SUCCESSFULLY AND COPIED.......'
"FREE DS("OUTPUT_DSN")"
RETURN |
I am using this as a line command against a particular dataset.
It allocates the output dataset perfectly. But when it tries to call IEBCOPY, it goes to an infinite loop and no response been received. I have used Attention key then to terminate the call.
Is any permissions required for my profile from installation team to use 'Call' in Rexx?
Thanks! |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I see nothing unusual in the code, and no, I seriously doubt that you would require special permissions to use the TSO CALL command.
Can you post a runtime TRACE? |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Why using a dummy sysprint?
I miss the sysin allocation and statement, something like
C O=I1,I=I1 |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Peter, you may be on to something.
On my system, for this code to work, I first had to change the SYSPRINT allocation to add the REUSE parameter (WHY, WHY, WHY don't you guys automatically put in REUSE when you allocate your DD's)? And, IEBCOPY did need me to allocate a SYSIN, although I just specified DD DUMMY, since by default IEBCOPY will copy all members from SYSUT1 to SYSUT2. Without the SYSIN allocation, IEBCOPY prompted for the input from the terminal. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
PeterHolland is awarded 3 points.
I had exactly the same problem some weeks back with IEBGENER, because no SYSIN was defined it just sat there waiting for terminal input.
If there is no SYSIN info then define it as DUMMY. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Of course, those allocations MAY be resident in the calling JCL. |
|
Back to top |
|
|
satheeshkamal
New User
Joined: 09 Jan 2007 Posts: 28 Location: Chennai
|
|
|
|
Thanks guys. I have changed that particular part of code to like below and it worked like sweet
Code: |
IF SUBSTR(SYSDSORG,1,2) = 'PO' THEN
DO
"ALLOC F(SYSPRINT) DUMMY"
"ALLOC F(SYSIN) UNIT(SYSDA) SPACE(1 1) TRACKS REUSE"
SYSIN.0 = 1
SYSIN.1 = " C I=SYSUT1,O=SYSUT2"
"EXECIO * DISKW SYSIN (FINIS STEM SYSIN."
DROP SYSIN.
"CALL *(IEBCOPY)"
"FREE F(SYSPRINT)"
"FREE F(SYSIN)"
END |
expat,
Quote: |
If there is no SYSIN info then define it as DUMMY. |
Defining Sysin as dummy was still giving the same issue. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
How did that cause a looping problem though? If IEBCOPY was prompting you for the SYSIN input from the terminal, weren't you responding to it? |
|
Back to top |
|
|
satheeshkamal
New User
Joined: 09 Jan 2007 Posts: 28 Location: Chennai
|
|
|
|
It was prompting for input...i thought it went to infinite loop because when i pressed the attention key - it terminated at the CALL statement.
Will giving "C I=SYSUT1,O=SYSUT2" in the terminal solve the issue?
I will try it now... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Wierd - mine works if I do or don't allocate SYSIN. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
satheeshkamal wrote: |
Will giving "C I=SYSUT1,O=SYSUT2" in the terminal solve the issue? |
Possibly, or just terminating the input stream (/*). |
|
Back to top |
|
|
satheeshkamal
New User
Joined: 09 Jan 2007 Posts: 28 Location: Chennai
|
|
|
|
This is what i did in sequence...
1. Executed the command with the original code (allocating sysprint as dummy and not allocating sysin).
I got the below message
Code: |
COPYING IS IN PROGRESS ......
IKJ56246I FILE SYSPRINT NOT ALLOCATED, FILE IN USE |
Then
2. Gave the below input
and got the below messages
Code: |
IEBCOPY MESSAGES AND CONTROL STATEMENTS PAGE 1
IEB1135I IEBCOPY FMID HDZ1A10 SERVICE LEVEL UA46465 DATED 20090319 DFSMS 01.
10.00 z/OS 01.10.00 HBB7750 CPU 2096
IEB1035I HCLSKSU IKJHSC1 IKJHSC1 23:46:30 THU 11 MAR 2010 PARM='' |
3. And the terminal was still prompting for input and gave the same
Then got the below message and other successful copy messages. The dataset is copied perfectly.
Code: |
IKJHSC1 COPY INDD=SYSUT1,OUTDD=SYSUT2 GENERATED STATEMENT |
|
|
Back to top |
|
|
satheeshkamal
New User
Joined: 09 Jan 2007 Posts: 28 Location: Chennai
|
|
|
|
When i executed the same command again...it prompted for input...i gave
'/* few times and no informational messages from IEBCOPY has been displayed and dataset was still copied perfectly.
Thanks |
|
Back to top |
|
|
satheeshkamal
New User
Joined: 09 Jan 2007 Posts: 28 Location: Chennai
|
|
|
|
expat, may be you can try log off the TSO session and try again. the terminal might prompt you for input. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Here's what I used. And it works just fine if I comment out SYSIN or not.
Code: |
/* REXX *** INVOKE IEBCOPY FROM TERMINAL */
SYSUID = STRIP(SYSVAR(SYSUID))
"FREE FI(SYSIN,SYSUT1,SYSUT2,SYSUT3,SYSPRINT)"
"DEL '"SYSUID".IEBCOPY.TEMP.OUT'"
"ALLOC FI(SYSIN) DUMMY RECFM(F B) LRECL(80)"
"ALLOC FI(SYSUT1) DA('"SYSUID".REXX') SHR"
"ALLOC FI(SYSUT2) DA('"SYSUID".IEBCOPY.TEMP.OUT') NEW TRACKS DIR(134)
SPACE(75 75) RECFM(F B) LRECL(80)"
"ALLOC FI(SYSUT3) TRACKS SPACE(750 750)"
"ALLOC FI(SYSPRINT) SYSOUT(A)"
"CALL *(IEBCOPY)"
"FREE FI(SYSIN,SYSUT1,SYSUT2,SYSUT3,SYSPRINT)"
EXIT |
|
|
Back to top |
|
|
satheeshkamal
New User
Joined: 09 Jan 2007 Posts: 28 Location: Chennai
|
|
|
|
I have used code similar to this.
Code: |
"ALLOC F(SYSPRINT) DUMMY"
"ALLOC F(SYSIN) UNIT(SYSDA) SPACE(1 1) TRACKS REUSE"
SYSIN.0 = 1
SYSIN.1 = " C I=SYSUT1,O=SYSUT2"
"EXECIO * DISKW SYSIN (FINIS STEM SYSIN."
DROP SYSIN.
"CALL *(IEBCOPY)"
"FREE F(SYSPRINT)"
"FREE F(SYSIN)" |
When it is executed first time, it worked fine. After that, if you comment out the SYSIN statements and run this again, it will still work fine.
But, if you log off the TSO session and then login again, execute the code which has the SYSIN statements commented out, the terminal should prompt you for input.
I think once it is executed, for that TSO session, the SYSIN might have been allocated until that session ends...I may be wrong in this...just a guess.
Thanks |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
LOGOFF/LOGON won't change a thing because anyway there is a FREE SYSIN before the IEBCOPY.
expat, maybe you're executing PDSFAST or another IEBCOPY replacement?
Usually there are little differences in their behaviour. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
With all the message codes being IEBnnnnI I would assume IEBCOPY. |
|
Back to top |
|
|
|