View previous topic :: View next topic
|
Author |
Message |
atulxp
New User
Joined: 27 Nov 2005 Posts: 15 Location: Phoenix
|
|
|
|
I need to write a file like
SIGNON -
&FROMDSN='GD.GT.TOGE(+1)' -
&FILENAME=GD.GT.TOGE.DYYMMDD -
CASE=YES
SIGNOFF
where YYMMDD is YearMonthDate so for today file would look
SIGNON -
&FROMDSN='GD.GT.TOGE(+1)' -
&FILENAME=GD.GT.TOGE.D070402 -
CASE=YES
SIGNOFF
Could some one help me to write corresponding REXX program for this. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
What is the problem that you want resolved.
What have you tried and what went wrong.
Can you post some output from your tests.
The DATE function of REXX is easy to use and will return the current date in a number of formats. Take a look at the manual and see. Just click the manuals button on the top of the page, and then find the REXX manual and you're away. |
|
Back to top |
|
|
manihcl85 Warnings : 1 New User
Joined: 11 Jan 2007 Posts: 52 Location: chennai
|
|
|
|
Hi,
Use the code below
Code: |
/*************REXX****************/
'FREE ALL'
"ALLOC DA('TEST.XXXXX.OUT') FI(OUTDD) SHR REUSE"
VAR1 = DATE(O)
DATE1 = SUBSTR(VAR1,1,2)||SUBSTR(VAR1,4,2)||SUBSTR(VAR1,7,2)
X.1="SIGNON - "
X.2=" "
X.3="&FROMDSN='GD.GT.TOGE(+1)'- "
X.4="&FILENAME=GD.GT.TOGE.D"||DATE1||" - "
X.5="CASE=YES"
X.6="SIGNOFF"
"EXECIO * DISKW OUTDD (STEM X. FINIS)" |
Regards,
Mani |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
I think that I would allocate the output file to a DD in the JCL. That way you don't have to mess around doing FREE and ALLOC in the REXX. Maybe another couple of changes too-
Code: |
/*************REXX****************/
QUEUE "SIGNON - "
QUEUE "&FROMDSN='GD.GT.TOGE(+1)'- "
QUEUE "&FILENAME=GD.GT.TOGE.D"SPACE(TRANSLATE(DATE(O),,'/'),0) " - "
QUEUE "CASE=YES"
QUEUE "SIGNOFF"
"EXECIO "QUEUED() "DISKW OUTDD ( FINIS)" |
|
|
Back to top |
|
|
pankajsoni
New User
Joined: 21 Jun 2006 Posts: 9 Location: Zurich
|
|
|
|
I think, this is a control card of a connect-direct job. I would recommend you to use Skel and define the date as a variable. You can use Rexx to submit this skel.
Regards,
Soni |
|
Back to top |
|
|
atulxp
New User
Joined: 27 Nov 2005 Posts: 15 Location: Phoenix
|
|
|
|
Thanks it resolved my problem |
|
Back to top |
|
|
|