IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How i can write such file in REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
atulxp

New User


Joined: 27 Nov 2005
Posts: 15
Location: Phoenix

PostPosted: Tue Apr 03, 2007 11:34 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Apr 03, 2007 12:20 pm
Reply with quote

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
View user's profile Send private message
manihcl85
Warnings : 1

New User


Joined: 11 Jan 2007
Posts: 52
Location: chennai

PostPosted: Tue Apr 03, 2007 2:58 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Apr 03, 2007 3:31 pm
Reply with quote

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
View user's profile Send private message
pankajsoni

New User


Joined: 21 Jun 2006
Posts: 9
Location: Zurich

PostPosted: Wed Apr 04, 2007 12:05 pm
Reply with quote

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
View user's profile Send private message
atulxp

New User


Joined: 27 Nov 2005
Posts: 15
Location: Phoenix

PostPosted: Fri Apr 06, 2007 8:32 am
Reply with quote

Thanks it resolved my problem
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top