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
 

 

Passing a variable/value to Rexx
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
ug123
Warnings : 1

New User


Joined: 01 Mar 2007
Posts: 39
Location: Chennai

PostPosted: Wed Jun 24, 2009 1:21 am    Post subject: Passing a variable/value to Rexx
Reply with quote

Hi all,

this is not as usual but something different.

I have a rexx program which submits the jcl. And in the JCL i have written an eazytrieve where I have introduced a count variable to find the total number of records in a dataset.

Now i have to pass this eazytrieve variable again to the same rexx code for further processing.

Could anyone help me out to pass the variable/value to the rexx program.

This is my eazytrieve

FILE INPUT1
*
WS-RECCOUNT W 15 N VALUE 0
*
JOB INPUT INPUT1 FINISH PRINT-PARA
WS-RECCOUNT = WS-RECCOUNT + 1
GOTO JOB
PRINT-PARA. PROC
DISPLAY 'NO OF RECORDS:' WS-RECCOUNT
END-PROC.


Thanks,
Ugandar
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Jun 24, 2009 1:29 am    Post subject:
Reply with quote

You can't. What happens if the job you submitted doesn't run for 4 hours.
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 982
Location: Oostende, Belgium

PostPosted: Wed Jun 24, 2009 1:29 am    Post subject: Re: Passing a variable/value to Rexx
Reply with quote

ug123 wrote:
this is not as usual but something different.

I have a rexx program which submits the jcl. And in the JCL i have written an eazytrieve where I have introduced a count variable to find the total number of records in a dataset.


And how do you expect to know the REXX exec will know when the EZ job has finished? This is more of the "usual", people trying to create a home-grown scheduler.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jun 24, 2009 1:35 am    Post subject:
Reply with quote

Hello,

Hopefully, you do not intend for an online rexx to wait for the batch job to run. . .

Suggest you end the first rexx when the job is submitted and at the end of the batch easytrieve, invoke rexx in batch. The easytrieve process would write the count into a dataset to be read/used by the batch rexx.
Back to top
View user's profile Send private message
ug123
Warnings : 1

New User


Joined: 01 Mar 2007
Posts: 39
Location: Chennai

PostPosted: Wed Jun 24, 2009 1:40 am    Post subject: Reply to: Passing a variable/value to Rexx
Reply with quote

Wow!!! I hope calling rexx in batch will help me. thanks for your info... i will try and let you know. once again thank you very much...

regards,
Ugandar
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Wed Jun 24, 2009 2:00 am    Post subject: Reply to: Passing a variable/value to Rexx
Reply with quote

icon_rolleyes.gif
Back to top
View user's profile Send private message
ug123
Warnings : 1

New User


Joined: 01 Mar 2007
Posts: 39
Location: Chennai

PostPosted: Wed Jun 24, 2009 9:49 am    Post subject: Reply to: Passing a variable/value to Rexx
Reply with quote

Hi,

I am not able to display the value in the screen when I run the rexx in batch mode.

I could see only in the spool. Is there any other way to display the value in screen.



Thanks,
Ugandar
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 24, 2009 11:20 am    Post subject: Re: Reply to: Passing a variable/value to Rexx
Reply with quote

ug123 wrote:
Hi,
I am not able to display the value in the screen when I run the rexx in batch mode.
I could see only in the spool. Is there any other way to display the value in screen.
Thanks,
Ugandar

And how do you propose that two totally unrelated address spaces to interact together and pass data ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7905
Location: Bellevue, IA

PostPosted: Wed Jun 24, 2009 5:09 pm    Post subject:
Reply with quote

expat, maybe through a scheduler -- something like CA-7 or Zeke or ... ?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jun 24, 2009 8:40 pm    Post subject:
Reply with quote

Hello,

Quote:
I am not able to display the value in the screen when I run the rexx in batch mode.
I could see only in the spool. Is there any other way to display the value in screen.
Why not simply look at the info in the spool?

You could write the "answer" to some file or member and then later read this into an online screen. If you use NOTIFY in the batch job, you will get an interruption on the screen to tell you the job ended.
Back to top
View user's profile Send private message
d_pansare

New User


Joined: 25 Apr 2009
Posts: 20
Location: Pune

PostPosted: Thu Jun 25, 2009 5:18 pm    Post subject:
Reply with quote

If you just want to count the records in Ezytrv and then display it on screen using rexx then in such scenario why don't you let rexx do both the things for you.. get the count from rexx itself and use it further down the lane for whatever process you want.... icon_confused.gif icon_confused.gif icon_confused.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 25, 2009 5:54 pm    Post subject:
Reply with quote

For a start REXX is one of the slowest and highest resouce comsumers for heavy IO. So would use far more resource and take longer than most other methods.

In addition as the OP is talking about getting the result back to the screen it would appear that this REXX will be processed in foreground, thus locking the terminal from being used by anything else for the duration of this process.

Had you have bothered to search the forum before answering you would have found that this topic has been discussed numerous times before and as always is given the thumbs down as a method of doing what the OP wants. Although REXX can invoke many other programs or utilities to perform the count and return the value, this still locks the terminal and prevents work.
Back to top
View user's profile Send private message
d_pansare

New User


Joined: 25 Apr 2009
Posts: 20
Location: Pune

PostPosted: Thu Jun 25, 2009 6:18 pm    Post subject:
Reply with quote

Quote:

Although REXX can invoke many other programs or utilities to perform the count and return the value, this still locks the terminal and prevents work.


I am in complete agreement with you.. But just thought if there is no other way... and author still wants have the output on the screen then he will have to use this method irrespective of time that will elapse to get the output...
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jun 26, 2009 2:24 am    Post subject:
Reply with quote

Hello,

Quote:
But just thought if there is no other way...
There is nearly always "another way". Unfortunately, "other ways" often require more actual effort and thus become undesirable. . .

Quote:
then he will have to use this method irrespective of time that will elapse to get the output
which is how an incredible number of really pathetic processes are being justified and causing problems on lots of systems now being supported/maintained by rather incompetent system management people. In previous days, something would not be permitted. . .
Back to top
View user's profile Send private message
ug123
Warnings : 1

New User


Joined: 01 Mar 2007
Posts: 39
Location: Chennai

PostPosted: Fri Jun 26, 2009 2:35 am    Post subject: Reply to: Passing a variable/value to Rexx
Reply with quote

Hi all,

I tried to count the total number of records using REXX program. But it helps only if the dataset has less than 2 lakhs of records. If the dataset has more number of records, REXX variable is not able to store and throwing an error message as 'unable to obtain storage'.

Thanks,
Ugandar
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jun 26, 2009 2:40 am    Post subject:
Reply with quote

Hello,

You should not be running this in rexx. . . .
Back to top
View user's profile Send private message
d_pansare

New User


Joined: 25 Apr 2009
Posts: 20
Location: Pune

PostPosted: Fri Jun 26, 2009 1:50 pm    Post subject:
Reply with quote

Quote:

If the dataset has more number of records, REXX variable is not able to store and throwing an error message as 'unable to obtain storage'.



You got this kind of error because you must be reading the whole file in an array and getting your record count using value present in '0' th node. This will work unless and until your array does't take the storage space more than 2MB ( 2 MB is the threshold storage limit for REXX program variables ).

If upfront you are aware that size of your file is more thab 2 mb then don't read the entire file rather keep reading one by one record until you reach the end of file...

Let me know if you would like to have the code to count the record....

_________________

Always there to give and take the HELP !!!!!
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Jun 26, 2009 1:54 pm    Post subject: Reply to: Passing a variable/value to Rexx
Reply with quote

Quote:
2 MB is the threshold storage limit for REXX program variables

please quote or give the link to the manual where You read that
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Jun 26, 2009 2:06 pm    Post subject:
Reply with quote

And also pay attention to the comment of Dick above.

I await your reply to Enricos request eagerly, having processed files of over 10Mb in the past.
Back to top
View user's profile Send private message
d_pansare

New User


Joined: 25 Apr 2009
Posts: 20
Location: Pune

PostPosted: Fri Jun 26, 2009 4:31 pm    Post subject:
Reply with quote

Apologies.. I quoted the wrong figure..

Here is the snapshot of what is mentioned in TSO/E REXX reference manual..

<<<<<<<<<<<<<<<<<<<<<<

There is no limit to the length of the values of variables, as long as all variables fit
into the storage available.
Implementation maximum: No single request for storage can exceed the fixed
limit of 16 MB. This limit applies to the size of a variable plus any control
information. It also applies to buffers obtained to hold numeric results.

>>>>>>>>>>>>>>>>>>>>>>>>

Here is the link ...

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/IKJ4A370/2.0?DT=20060626210253

So if this true then one cannot write the whole file to array if the size is more than 16MB....

Again sorry for the confusion as far as actual storage is concerned...




[/url]
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


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