Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Why does sysdsn act funny ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
vinaysetlur

New User


Joined: 04 Jan 2008
Posts: 13
Location: United States

PostPosted: Wed Jan 29, 2014 2:11 am    Post subject: Why does sysdsn act funny ?
Reply with quote

Hi , I ran into this strange issue that is as follows: -
Method of execution: - TSO
I get the dataset name from the user and pass it using a simple say and pull combination.
I then use queue to push IDCAMS allocate statements into the external data queue and then invoke IDCAMS using Address link.
The call is successfull and the dataset is created.
However when I code a sysdsn check in my program , it says that the dataset is not created.
I am familiar with the 'problem' with quotes on sysdsn . A quick reference says it all. But this is really strange because on a separate standalone invocation of the sysdsn alone, it recognizes and honors the dataset existence.

Here's the code:
Code:
/*   rexx   */
 say ' Pass Dsname   '
 pull dsname
 address tso
"alloc f(sysprint) new reu unit(vio) lrecl(121)",
"recfm(f b) space(1) tra"
"ALLOC F(SYSIN) DUMMY REU "
 q = ''
 q.0 = 3
 q.1 = "   ALLOC DSN('"dsname"') "
 q.2 = "   SPACE(1,1) CYL LRECL(80) BLKSIZE(80) RECFM(F)"
 q.3 = "   DSORG(PS) NEW CAT STORCLAS(STND) "
do i=1 to q.0
   q = q||q.i
end
queue q
queue
 address link 'IDCAMS'
 "free f(sysin sysprint)"
 if rc/=0 then say 'rc = ' rc
 else
   do
       x = sysdsn("'"dsname"'")
       if x  = 'OK' then say 'DS is created !!! '
       else
        say 'Error' X
   end
 exit
Code'd
Back to top
View user's profile Send private message

vinaysetlur

New User


Joined: 04 Jan 2008
Posts: 13
Location: United States

PostPosted: Wed Jan 29, 2014 2:30 am    Post subject: Reply to: Why does sysdsn act funny ?
Reply with quote

Looks like this is because the "dataset only gets created" when the complete exec is run . Because that is one unit of work ?
In other words,
The dataset is not created after the IDCAMS execution and not yet until the last line of the code gets executed.
I am living with this notion currently and keeping the thread open for any different views or ideas on this.

Thanks in anticipation
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Wed Jan 29, 2014 11:31 pm    Post subject: Reply to: Why does sysdsn act funny ?
Reply with quote

It is not clear why you use IDCAMS for allocation.

Why not just use TSO?
Code:
 Address TSO "ALLOC DSN('"dsname"') ",
    "   SPACE(1,1) CYL LRECL(80) BLKSIZE(80) RECFM(F)",
    "   DSORG(PS) NEW CAT STORCLAS(STND) "
Back to top
View user's profile Send private message
vinaysetlur

New User


Joined: 04 Jan 2008
Posts: 13
Location: United States

PostPosted: Thu Jan 30, 2014 1:43 am    Post subject: Reply to: Why does sysdsn act funny ?
Reply with quote

That is true . We can use TSO . In fact , we must always so that we keep things straight and simple.

But this was a intended as a demo for my other team members on how to invoke IDCAMS through REXX. So under that intention , I used a simple ALLOC statement for IDCAMS .
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 460
Location: The Universe

PostPosted: Thu Jan 30, 2014 3:22 am    Post subject: Re: Why does sysdsn act funny ?
Reply with quote

vinaysetlur wrote:
...
"ALLOC F(SYSIN) DUMMY REU "
...
address link 'IDCAMS'
"free f(sysin sysprint)"
if rc/=0 then say 'rc = ' rc
else ...
  1. How is IDCAMS even seeing your statements?
  2. I think the return code you are testing is the return code from the TSO FREE command.
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Thu Jan 30, 2014 8:20 am    Post subject:
Reply with quote

If you comment out the call to IDCAMS also, your dataset will get created. I found that, your code
Code:
 q = ''
 q.0 = 3
 q.1 = "   ALLOC DSN('"dsname"') "
 q.2 = "   SPACE(1,1) CYL LRECL(80) BLKSIZE(80) RECFM(F)"
 q.3 = "   DSORG(PS) NEW CAT STORCLAS(STND) "
do i=1 to q.0
   q = q||q.i
end
queue q 
is generating the Dataset, after the execution by TSO.

and as per your issue about SYSDSN, Since the allocation command processing at the end of your program, there was no information about the file existence at the time of SYSDSN execution.
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Thu Jan 30, 2014 8:15 pm    Post subject: Reply to: Why does sysdsn act funny ?
Reply with quote

I have never seen IDCAMS to pull from the TSO stack. Where did you get the idea that it would?

Instead of QUEUEing the command, put them in a SYSIN file before you call IDCAMS.
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 460
Location: The Universe

PostPosted: Thu Jan 30, 2014 9:13 pm    Post subject:
Reply with quote

Pedro: Agreed, but first he has to write the command to a SYSIN data set that is a real data set, not DUMMY. If he is going to write the lines he has placed in the q array, he has to indicate the first and second lines are continued for IDCAMS.

sureshpathi10: Agreed, but then why is SYSDSN not working? Possibly because of the flawed return code test?

There are so many problems with the Rexx EXEC I think the TS should start over.
  • Use TSO to do the allocation.
  • Forget IDCAMS
  • Test the return code after the allocate command.
  • Free the data set before he exits the Rexx exec.
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Thu Jan 30, 2014 10:08 pm    Post subject: Reply to: Why does sysdsn act funny ?
Reply with quote

I recall this from the original poster:
Quote:
intended as a demo ... on how to invoke IDCAMS through REXX
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Thu Jan 30, 2014 10:13 pm    Post subject: Reply to: Why does sysdsn act funny ?
Reply with quote

Quote:
sureshpathi10: Agreed, but then why is SYSDSN not working?

He is putting the ALLOCATE in the stack. The stack apparently gets executed after the rexx program completes. At the time of the SYSDSN function, the ALLOCATE is still in the stack and has not yet been executed.
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 460
Location: The Universe

PostPosted: Thu Jan 30, 2014 10:38 pm    Post subject:
Reply with quote

Just another lesson to me I should not butt in where I really don't know much about Rexx. I deduced he was building something in the queue. Silly me, I thought it was executed immediately! Thanks Pedro.
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Thu Jan 30, 2014 11:54 pm    Post subject: Reply to: Why does sysdsn act funny ?
Reply with quote

There are some commands, such as CONSOLE, ACCOUNT, TEST, and IPCS where it will change from 'READY' prompt to some other prompt (or blank). For those commands, I think it will pull subcommands from the stack.

Also, some commands, such as RECEIVE, will prompt the user for missing parameters. I think it will pull from the stack. When you add stuff to the stack, it is not executed immediately, but pulled by the program as needed.

However, IDCAMS is not such a command. To my knowledge, it will not pull from the stack.
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Fri Jan 31, 2014 9:47 am    Post subject:
Reply with quote

Thanks for backing up Pedro.... As Pedro mentioned earlier, IDCAMS looks for commands to execute in SYSIN file.
Back to top
View user's profile Send private message
vinaysetlur

New User


Joined: 04 Jan 2008
Posts: 13
Location: United States

PostPosted: Sat Feb 01, 2014 2:39 am    Post subject: Reply to: Why does sysdsn act funny ?
Reply with quote

Sorry. I had been out for a while and not following the updates.
I guess , this is what I had also mentioned as my notion and cannot agree any less with Pedro's note: -
Quote:
"The stack apparently gets executed after the rexx program completes. At the time of the SYSDSN function, the ALLOCATE is still in the stack and has not yet been executed."


In other words : -
Quote:
The dataset is not created after the IDCAMS execution and not yet until the last line of the code gets executed.

Also I did try to write to sysin. But it had failed with a different error and that's when i tried to directly put data to the stack via queue and pass that to IDCAMS. I then kept SYSIN dummy .

This was the error I received
    IEC141I 013-34,IGG0191A,E8751AJ,IKJACCNT,SYSIN,VIO , ,,
    SYS14031.T121543.RA000.E8751AJ.R0396963,
    ***,

when I tried to allocate SYSIN as follows: -
Code:
"alloc f(SYSIN) new reu unit(vio) lrecl(80) recfm(f b) space(1) tracks"


Then I looked up the IEC141I 013-34 message and changed recfm to variable with some blocksize for sysin as follows: -
Code:
"alloc f(SYSIN) new reu unit(vio) lrecl(80) recfm(v) space(1) tracks blksize(800)"

and it worked OK. But the sysdsn doesn't detect the dataset which is because of the dataset not getting created yet at the time of call.
Thanks , this thread may now be closed
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Funny, but actually not funny at all... prino General Talk & Fun Stuff 1 Mon Mar 11, 2013 6:11 pm
No new posts SYSDSN fails on 3rd dataset during logon kdgillilan CLIST & REXX 1 Fri Oct 26, 2012 8:12 pm
No new posts Some funny COBOL 'PIC'tures Bill Woodger COBOL Programming 2 Tue Dec 13, 2011 9:49 pm
No new posts Allegedly Funny Stuff Bill Woodger General Talk & Fun Stuff 5 Fri Sep 30, 2011 4:27 pm
No new posts Problem with SYSDSN parameter for GDGs maheshk84 CLIST & REXX 6 Fri Aug 19, 2011 9:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us