View previous topic :: View next topic
|
Author |
Message |
Deepakgoyal2005
New User
Joined: 22 Mar 2007 Posts: 57 Location: India
|
|
|
|
Requirement is -
After a particular CLIST command is executed a PDS member (member name = userid) should be updated by certain information.
My CLIST command is for opening a given member existing in a PDS (specified in command).
I had tried with the following Code:
Code: |
PROC 1 MBR
/**********************************************************************/
/* REXX */
/**********************************************************************/
IF &SYSDSN('DE00.T0000000.ECMS.CPY(&MBR)') = OK +
THEN ISPEXEC VIEW DATASET('DE00.T0000000.ECMS.CPY(&MBR)')
ELSE WRITE COMPONENT DOES NOT EXIST - &MBR
END
user = userid()
MYDSN = "'DE00.THTSUTIL.ECMS.IDS("user")'"
"ALLOC DD(PDSID) DA("MYDSN") SHR"
Queue 'line1 : Should be written in member ' user on date()
Queue 'line2 : Should be written in member ' user at time()
"EXECIO "Queued()" DISKW PDSID (FINIS"
"FREE DD(PDSID)"
exit
|
The above code is not giving any error and opens member DE00.T0000000.ECMS.CPY(MEMBER), when TSO <CLIST Command name> MEMBER is entered in command line.
But it do not write records in the PDS(DE00.THTSUTIL.ECMS.IDS) with member name = Userid of the person executing the CLIST command.
The logic of writing member in PDS DE00.THTSUTIL.ECMS.IDS works fine when executed separately without logic of opening member in PDS DE00.T0000000.ECMS.CPY |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
CLIST and rexx are two separate languages. You are mixing CLIST statements with REXX statements. If you are writing something new, you should use REXX only. |
|
Back to top |
|
|
Deepakgoyal2005
New User
Joined: 22 Mar 2007 Posts: 57 Location: India
|
|
|
|
Can anyone suggest for what are the required changes in the above code to change entirely to REXX or CLIST and solve the purpose. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Let's see if I understand the process.
The user enters the TSO/E command "TSO execname MEMBER".
The exec should check for the existence of the dataset:
'DE00.T0000000.ECMS.CPY(MEMBER)'
and if OK then it should open it for a BROWSE session, otherwise a message should be displayed to the user and the exec should exit.
After the user ends the BROWSE session, another library:
''DE00.THTSUTIL.ECMS.IDS("userid")' is allocated and two lines are written to that member:
'line1 : Should be written in member 'userid' on 'date()
'line2 : Should be written in member 'userid' at 'time()
Is it just those two lines written every time, or do we need to add logic to first read any existing lines, then add two new ones to the (bottom or top)? |
|
Back to top |
|
|
Deepakgoyal2005
New User
Joined: 22 Mar 2007 Posts: 57 Location: India
|
|
|
|
Your understanding is absolutely correct Superk.
We need to add logic to first read any existing lines, then add two new ones to the bottom. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Snipped from TSO/E REXX Reference (In EXECIO paragraph):
Quote: |
To append information to a member of a PDS, rewrite the member with the additional records added. |
|
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Try this:
Code: |
/**********************************************************************/
/* REXX */
/**********************************************************************/
Parse Arg member
If SYSDSN("'DE00.T0000000.ECMS.CPY("member")'") = "OK" Then
ISPEXEC VIEW DATASET('DE00.T0000000.ECMS.CPY("member")')
Else
Do
Say "COMPONENT DOES NOT EXIST - "member
Exit
End
user = Userid()
mydsn = "''DE00.THTSUTIL.ECMS.IDS("user")'"
"ALLOC DD(PDSID) DA("mydsn") SHR REUSE"
If SYSDSN(mydsn) = "OK" Then "EXECIO * DISKR PDSID (FINIS"
Queue 'line1 : Should be written in member 'user' on 'date()
Queue 'line2 : Should be written in member 'user' at 'time()
"EXECIO "Queued()" DISKW PDSID (FINIS"
"FREE DD(PDSID)"
exit
|
|
|
Back to top |
|
|
Deepakgoyal2005
New User
Joined: 22 Mar 2007 Posts: 57 Location: India
|
|
|
|
It worked as required with only small change in syntax -
Working Code -
Code: |
/* REXX */
/**********************************************************************/
Parse Arg member
If SYSDSN("'DE00.T0000000.ECMS.CPY("member")'") = "OK" Then
"ISPEXEC VIEW DATASET('DE00.T0000000.ECMS.CPY("member")')"
Else
Do
Say "COMPONENT DOES NOT EXIST - " member
Exit
End
user = Userid()
mydsn = "'DE00.THTSUTIL.ECMS.IDS("user")'"
"ALLOC DD(PDSID) DA("mydsn") SHR REUSE"
If SYSDSN(mydsn) = "OK" Then "EXECIO * DISKR PDSID (FINIS"
Queue 'line1 : Should be written in member 'user' on 'date()
Queue 'line2 : Should be written in member 'user' at 'time()
"EXECIO "Queued()" DISKW PDSID (FINIS"
"FREE DD(PDSID)"
exit
|
Thanks Superk for your valuable inputs. |
|
Back to top |
|
|
|