IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

TSO Call to Iebcopy - Does not end


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
satheeshkamal

New User


Joined: 09 Jan 2007
Posts: 28
Location: Chennai

PostPosted: Thu Mar 11, 2010 5:09 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Mar 11, 2010 6:08 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Mar 11, 2010 6:10 pm
Reply with quote

Why using a dummy sysprint?
I miss the sysin allocation and statement, something like
C O=I1,I=I1
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Mar 11, 2010 7:15 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Mar 11, 2010 7:16 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Mar 11, 2010 7:17 pm
Reply with quote

Of course, those allocations MAY be resident in the calling JCL.
Back to top
View user's profile Send private message
satheeshkamal

New User


Joined: 09 Jan 2007
Posts: 28
Location: Chennai

PostPosted: Thu Mar 11, 2010 7:40 pm
Reply with quote

Thanks guys. I have changed that particular part of code to like below and it worked like sweet icon_biggrin.gif

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Mar 11, 2010 7:49 pm
Reply with quote

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
View user's profile Send private message
satheeshkamal

New User


Joined: 09 Jan 2007
Posts: 28
Location: Chennai

PostPosted: Thu Mar 11, 2010 7:55 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Mar 11, 2010 8:30 pm
Reply with quote

Wierd - mine works if I do or don't allocate SYSIN.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Mar 12, 2010 1:46 am
Reply with quote

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
View user's profile Send private message
satheeshkamal

New User


Joined: 09 Jan 2007
Posts: 28
Location: Chennai

PostPosted: Fri Mar 12, 2010 11:22 am
Reply with quote

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
Code:
/*

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
Code:
/*

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
View user's profile Send private message
satheeshkamal

New User


Joined: 09 Jan 2007
Posts: 28
Location: Chennai

PostPosted: Fri Mar 12, 2010 11:23 am
Reply with quote

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
View user's profile Send private message
satheeshkamal

New User


Joined: 09 Jan 2007
Posts: 28
Location: Chennai

PostPosted: Fri Mar 12, 2010 11:25 am
Reply with quote

expat, may be you can try log off the TSO session and try again. the terminal might prompt you for input.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Mar 12, 2010 12:23 pm
Reply with quote

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
View user's profile Send private message
satheeshkamal

New User


Joined: 09 Jan 2007
Posts: 28
Location: Chennai

PostPosted: Fri Mar 12, 2010 12:55 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Fri Mar 12, 2010 1:09 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Mar 12, 2010 1:29 pm
Reply with quote

With all the message codes being IEBnnnnI I would assume IEBCOPY.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Call an hlasm from REXX in batch and ... CLIST & REXX 4
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Call program, directly from panel CLIST & REXX 9
No new posts Batch call online program, EXCI task ... CICS 3
No new posts CSQBGET - Call giving completion code... COBOL Programming 3
Search our Forums:

Back to Top