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

How to Access Natural EDIT COMMANDS thru JCL ??


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
venkat.bmw
Warnings : 2

New User


Joined: 05 May 2009
Posts: 21
Location: India

PostPosted: Tue Jul 20, 2010 3:10 pm
Reply with quote

I need to Access Natural EDIT COMMANDS thru JCL :

For example:

Consider a program - pgm1

pgm1:

DEFINE DATA LOCAL
1 #FIRST (N1)
1 #SHIP (N1)
END-DEFINE
IF #FIRST = 2
ADD 1 TO #SHIP
END-IF
DISPLAY #SHIP
END


This above program i need to access thru jcl and then using edit command
'CHANGE' , i need replace #SHIP to #SECOND . Any options ??
Back to top
View user's profile Send private message
venkat.bmw
Warnings : 2

New User


Joined: 05 May 2009
Posts: 21
Location: India

PostPosted: Tue Jul 20, 2010 5:53 pm
Reply with quote

Not only CHANGE .. you can tell some other EDIT commands also
Back to top
View user's profile Send private message
abhi484u
Warnings : 1

New User


Joined: 31 Aug 2006
Posts: 9

PostPosted: Tue Jul 20, 2010 6:03 pm
Reply with quote

//STEP01 EXEC NATURALD,COND=(3,LT),
// OPT='MADIO=0,MT=0,AUTO=ON,WH=ON,ETID=CSEL200'
//SYSIN DD *
LOGON <libraryname>
SCAN
S
<scanvalue>
<replace value>
<libraryname>
<programname>
P /* P for Program
Y /* Y for absolute scan

FIN
/*


hopw this will save you purpose
Back to top
View user's profile Send private message
abhi484u
Warnings : 1

New User


Joined: 31 Aug 2006
Posts: 9

PostPosted: Tue Jul 20, 2010 6:17 pm
Reply with quote

I also tried like
//STEP01 EXEC NATURALD,COND=(3,LT),
// OPT='MADIO=0,MT=0,AUTO=ON,WH=ON,ETID=CSEL200'
//SYSIN DD *
LOGON <libraryname>
E <programname>
SCAN FUNC=S SVAL=value1 RVAL=value2 LIB=SYSTEM TYPE=P OBJ=<program>
FIN

But it is not working...no idea why
Back to top
View user's profile Send private message
venkat.bmw
Warnings : 2

New User


Joined: 05 May 2009
Posts: 21
Location: India

PostPosted: Tue Jul 20, 2010 6:37 pm
Reply with quote

We can correct the programs easily without any long procedures n approvals...
Back to top
View user's profile Send private message
abhi484u
Warnings : 1

New User


Joined: 31 Aug 2006
Posts: 9

PostPosted: Tue Jul 20, 2010 6:46 pm
Reply with quote

Sorry I didn't get what u meant...
Back to top
View user's profile Send private message
venkat.bmw
Warnings : 2

New User


Joined: 05 May 2009
Posts: 21
Location: India

PostPosted: Tue Jul 20, 2010 6:52 pm
Reply with quote

Suppose if we are moving wrong code to PROD .. then tis JCL we can correct the programs easily ...
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jul 20, 2010 8:20 pm
Reply with quote

The SCAN-REPLACE option would be my favorite.

In addition, you can write a "driver" program to manipulate and run sources using the USR2014 user exit.

Also, take a look at the EDT command.

O.
Back to top
View user's profile Send private message
venkat.bmw
Warnings : 2

New User


Joined: 05 May 2009
Posts: 21
Location: India

PostPosted: Tue Jul 20, 2010 9:15 pm
Reply with quote

I think using EDT command ,we can write new pgm but we cant make changes in existing program !!!!
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jul 20, 2010 9:53 pm
Reply with quote

Not true. EDT works fine with existing source.

O.
Back to top
View user's profile Send private message
Ralph Zbrog

New User


Joined: 21 Nov 2009
Posts: 58
Location: California

PostPosted: Tue Jul 20, 2010 11:22 pm
Reply with quote

This is a bad idea.

SCAN was intended for mass changes, for example to replace #FIELD-NAME1 with #FIELD-NAME2 in all modules in a library. It does not allow much in the selection of lines.

The batch editor, invoked with EDT, is suited to creating new programs. Although you can scan for a text string, there is no REPLACE function, so you have to supply a replacement line or a new line for insertion. That means that you have to know exactly what the code looks like beforehand.

USR1014N gives you full functionality of the Natural editor, but would be overkill for the type of change suggested by venkat.bmw.

Be careful. All of these techniques can easily run you into trouble.

And finally, none of these techniques should be used to manipulate production code! Every one of my clients would consider such an attempt cause for dismissal. I'm surprised that this is even possible in your shop; your Natural Security profile should disallow SAVE and CAT commands in the production environment. Use your standard migration procedures to fix production code.
Back to top
View user's profile Send private message
venkat.bmw
Warnings : 2

New User


Joined: 05 May 2009
Posts: 21
Location: India

PostPosted: Wed Jul 21, 2010 9:01 am
Reply with quote

Hey Ralph Zbrog,

Thank for ur advice . This is jus a try !! a new way .... we are not gonna follow tis .. but tis will help us to know the flexibility of natural icon_confused.gif
Back to top
View user's profile Send private message
abhi484u
Warnings : 1

New User


Joined: 31 Aug 2006
Posts: 9

PostPosted: Wed Jul 21, 2010 10:38 am
Reply with quote

I am also against editing of production code directly witha batch.
But you got an nice alternative, but it is a raw form of editing and idea is to read and edit the FUSER ADABAS file.
But never ever I suggest this except for efficient search methdologies. Thanks
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Jul 21, 2010 10:43 am
Reply with quote

Quote:
but tis will help us to know the flexibility of natural


Natural's nickname is flexible, sometimes even too-flexible icon_biggrin.gif

O.
Back to top
View user's profile Send private message
venkat.bmw
Warnings : 2

New User


Joined: 05 May 2009
Posts: 21
Location: India

PostPosted: Wed Jul 21, 2010 11:13 am
Reply with quote

Hey guys .. come on !! .. Pls stop voting ( Against or not ) ... Think abt the solution icon_smile.gif !!!!!!!
Back to top
View user's profile Send private message
Ralph Zbrog

New User


Joined: 21 Nov 2009
Posts: 58
Location: California

PostPosted: Wed Jul 21, 2010 12:32 pm
Reply with quote

It's a long, difficult road from rookie to journeyman to expert. To achieve the highest level, you need to know what Natural can do, when to use specific features, and when not to use them. From an educational perspective, a valid question was posed (and it was answered), but any suggestion of manipulating production code must be answered with a strong warning.

I have had little use for SCAN/REPLACE, and I don't like that it provides no audit trail. EDT is fine for uploading source to mainframe Natural - from a PDS member or flat file - but it's too cumbersome for changing code. USR2014N is great for source code-generating utilities. But I would not use these techniques to maintain/modify existing code. For mass changes, Natural Engineer is a better solution.

Rather than edit in batch, make and test the code changes on-line, export the modified source to a flat file, and load the flat file into the target environment as a complete module via EDT (presuming that you can't use standard procedures, like SYSMAIN, SYSOBJH, PAC, or N2O).
Back to top
View user's profile Send private message
anilscomputer

New User


Joined: 26 May 2008
Posts: 7
Location: Trivandrum

PostPosted: Wed Jul 21, 2010 2:58 pm
Reply with quote

Eagar,
From the prev post there is a tedious way to get around the question
load the pgm into a flat file change it using jcl save it back to work area. ( provided the pgm name should be diffrent) icon_biggrin.gif
Warning!! Solution not to be practiced as it is not the correct way and doesnt give audit trail
Back to top
View user's profile Send private message
atulbagewadikar

New User


Joined: 15 Jun 2006
Posts: 26

PostPosted: Wed Jul 21, 2010 5:17 pm
Reply with quote

If you're submitting a JCL (batch) against NATPROD (production) with your user id, is not wise to modify source online using editor? (I believe if you have right to submit a batch against prod then you should be able to logon to NATPROD too).

Of course this is not a wise solution!
Back to top
View user's profile Send private message
venkat.bmw
Warnings : 2

New User


Joined: 05 May 2009
Posts: 21
Location: India

PostPosted: Wed Jul 21, 2010 6:21 pm
Reply with quote

Atul,

U r thinking og test jobs but we can use user request jobs .. Tis jobs will have access to update icon_smile.gif !!!!!
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 -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts How to access web services/website? Mainframe Interview Questions 4
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Need help to resolve a hard edit COBOL Programming 8
Search our Forums:

Back to Top