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

How to insert a line in a JCL using REXX code


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

New User


Joined: 15 May 2008
Posts: 41
Location: Chennai

PostPosted: Mon Mar 09, 2009 3:47 pm
Reply with quote

Hi,

How to insert a new line in a JCL using REXX. I need sample code for this.

If JCl is as shown below....

//SOMP0001 JOB (11111,TEST,PROG1),'SOMP0001',
// CLASS=7,
// MSGCLASS=X,
........

//*

Now i need to insert a line with NOTIFY=&SYSUID as shown below using REXX


//SOMP0001 JOB (11111,TEST,PROG1),'SOMP0001',
// CLASS=7,
// NOTIFY=&SYSUID,
// MSGCLASS=X,
........
//*
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Mar 09, 2009 3:50 pm
Reply with quote

There are examples of doing inserts and deletes on the forum.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Mar 09, 2009 3:51 pm
Reply with quote

saagu, you read the first line, thern write it out. You read the second line, then write it out. You create a new third line, then write it out. From there, you just read and write every other line until you reach the end.

Personally, I think youd be better off editing the file and easily inserting that new record.
Back to top
View user's profile Send private message
saagu

New User


Joined: 15 May 2008
Posts: 41
Location: Chennai

PostPosted: Mon Mar 09, 2009 3:52 pm
Reply with quote

I need a sample REXX code for the same.
Back to top
View user's profile Send private message
saagu

New User


Joined: 15 May 2008
Posts: 41
Location: Chennai

PostPosted: Mon Mar 09, 2009 3:54 pm
Reply with quote

Hi Kevin,

Yes you are write, but how to create a new line? I need this syntax please.

Regards,
Saagu
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Mar 09, 2009 4:06 pm
Reply with quote

saagu wrote:
I need a sample REXX code for the same.


Supplied - tested and documented - only 750 euro.

Please do not ask for code unless you are willing to pay for it. This is a help forum, not a do it for you forum.

As stated before, there are examples on the forum, please search for them.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Mar 09, 2009 4:13 pm
Reply with quote

Code:

/* REXX */
cnt = 0
Do Forever
  "EXECIO 1 DISKR i"
  If rc <> 0 Then Leave
  Parse Pull jcl
  cnt = cnt + 1
  Push jcl
  "EXECIO 1 DISKW o"
  If cnt = 3 Then
    Do
      Push "// NOTIFY=&SYSUID,"
      "EXECIO 1 DISKW o"
    End
End
"EXECIO 0 DISKR i (FINIS"
"EXECIO 0 DISKW o (FINIS"
Exit 0
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top