How to add date info when REXX creating new number?



IBM's Command List programming language & Restructured Extended Executor

How to add date info when REXX creating new number?

Postby yang li » Thu Aug 25, 2011 9:27 am

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.
Best regards
yang li
 
Posts: 10
Joined: Thu Apr 07, 2011 7:54 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby prino » Thu Aug 25, 2011 10:45 am

Look for the LMMSTATS service
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

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

Postby yang li » Thu Aug 25, 2011 1:56 pm

Great! This command works. Thanks.
Best regards
yang li
 
Posts: 10
Joined: Thu Apr 07, 2011 7:54 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby yang li » Thu Aug 25, 2011 3:02 pm

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
Best regards
yang li
 
Posts: 10
Joined: Thu Apr 07, 2011 7:54 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby prino » Thu Aug 25, 2011 3:45 pm

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")"
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

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

Postby MrSpock » Thu Aug 25, 2011 3:51 pm

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.
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

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

Postby NicC » Thu Aug 25, 2011 5:25 pm

(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'
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post