Page 1 of 1

How to add date info when REXX creating new number?

PostPosted: Thu Aug 25, 2011 9:27 am
by yang li
Hi,
Problem description:
I use Rexx to create one a member, member was created successfully. but there is no other info except member name . I expect to see user id, create date info adhere with the new member.
There are two members, in my PDS as below. (using - to keeping the format good. ignore - when you read.)
Name-----------Prompt--Size--Created--------Changed----------------------ID
TSTREXX-------------------15---2010/09/08---2011/08/24 23:02:36---USR012
BC6557C--------------------------------------------------------------------------------> there is no other info except name, i want at least have ID and created date .

First TSTREXX is created by ISPF 3.2
BC6557C is created follwing REXX code.
/* create new member */
PARSE UPPER ARG NMEM
DEST = PDSNAM || "(" || NMEM || ")"
ADDRESS TSO "ALLOC F(OUT) DS('"DEST"') SHR"

Question:
I want make the other info(ID, Created date) for BC6557C when rexx creating it. I checked the TSO command reference, got no help.
How to do it?

Thanks.

Re: How to add date info when REXX creating new number?

PostPosted: Thu Aug 25, 2011 10:45 am
by prino
Look for the LMMSTATS service

Re: How to add date info when REXX creating new number?

PostPosted: Thu Aug 25, 2011 1:56 pm
by yang li
Great! This command works. Thanks.

Re: How to add date info when REXX creating new number?

PostPosted: Thu Aug 25, 2011 3:02 pm
by yang li
Well, It works when I run rexx with tso command --> TSO EXEC rexmem
But it dosen't work when I run rexmem via JCL. RC(-3)
Does any one know the reason? BTW, what is DATAID?
here is rexx code
ADDRESS ISPEXEC                                       
"LMINIT DATAID("OUT") DATASET('"PDSNAM"') ENQ(SHR)"   
"LMOPEN DATAID("OUT")"                               
"LMMSTATS DATAID("OUT") MEMBER("NMEM"),USER("USERID()"
LMMSTATS_RC=RC                                       
"LMFREE DATAID("OUT")"                               
 RETURN LMMSTATS_RC   


Here is the log:
READY
LMMSTATS
12 *-* "LMINIT DATAID("OUT") DATASET('"PDSNAM"') ENQ(SHR)"
+++ RC(-3) +++
13 *-* "LMOPEN DATAID("OUT")"
+++ RC(-3) +++
14 *-* "LMMSTATS DATAID("OUT") MEMBER("NMEM"),USER("USERID()")"
+++ RC(-3) +++
16 *-* "LMFREE DATAID("OUT")"
+++ RC(-3) +++
READY

Re: How to add date info when REXX creating new number?

PostPosted: Thu Aug 25, 2011 3:45 pm
by prino
LMMSTATS and it's siblings only work under ISPF. Run your REXX under ISPF in batch.

DATAID is just an ID assigned by the system and your usage of it is wrong, the dataid on the LMINIT must be unquoted, unless OUT is unitialized (or dropped), as in

"ispexec lminit dataid(mydsn) ddname("whatever") enq(exclu)"
"ispexec view dataid("mydsn")"
"ispexec lmfree dataid("mydsn")"

Re: How to add date info when REXX creating new number?

PostPosted: Thu Aug 25, 2011 3:51 pm
by MrSpock
yang li wrote:Well, It works when I run rexx with tso command --> TSO EXEC rexmem
But it dosen't work when I run rexmem via JCL. RC(-3)
Does any one know the reason?


I would guess that you've failed to start ISPF in your job, and have failed to provide DD statements for all of the necessary ISPF libraries. You might want to review ISPF services in batch mode.

yang li wrote:BTW, what is DATAID?


I look at it as a sort of file handle.

Re: How to add date info when REXX creating new number?

PostPosted: Thu Aug 25, 2011 5:25 pm
by NicC
(using - to keeping the format good. ignore - when you read.)

Why not use the code button? It saves you the hassle of trying to line things up manually (usually unsuccessfully!). You may need to click on 'Full Editor' if you are using 'Quick Reply'