Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Scan Natural Library in Batch

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
View previous topic :: :: View next topic  
Author Message
sriramp777

New User


Joined: 29 Sep 2008
Posts: 6
Location: Bangalore

PostPosted: Mon Dec 22, 2008 10:44 am    Post subject: Scan Natural Library in Batch
Reply with quote

Hi,

Could anyone provide me some information to scan for a particular string in the Natural Libraries using Batch JCL.

Thanks in advance,
Sam
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Mon Dec 22, 2008 11:53 am    Post subject:
Reply with quote

First: Natural's SCAN is pretty tricky. I highly recommend you to run the scan on a copy library, or to create a backup before scanning.

Here is my way to perform batch SCAN in Natural:
Code:
//NAT   EXEC NATBATCH,REG=0M,                                           
//         P='IM=F,MADIO=0,MAXCL=0,AUTO=OFF,INTENS=1,PROFILE=KUKU'     
//CMSYNIN DD *                                                         
LOGON library                                                           
SCAN                                                                   
S                                                                       
scan-value                                                             
replace-value (or blank line)                                           
library (blank for current library)                                     
program-name or *                                                       
program-type or *                                                       
absolute (Y/N)                                                         
                                                                       
FIN                                                                     
/*                                                                     
//                                                                     
//**********************************************************************
//*                                                                    *
//* Attention: Although there are simpler ways to invoke NATURAL scan, *
//*                                                                    *
//*            this is the safest one.                                 *
//*                                                                    *
//*            This method let you scan for blank-delimited values,    *
//*                                                                    *
//*            and bypass the old bug that replace the first word in   *
//*                                                                    *
//*            the scan value by the second one.                       *
//*                                                                    *
//*            Do not delete the blank line at the end !!!             *   
//*                                                                    *
//*            If you don't have a 'replace' value, keep the           *
//*                                                                    *
//*            'replace-value' line blanked !!!                        *   
//*                                                                    *
//**********************************************************************


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

New User


Joined: 29 Sep 2008
Posts: 6
Location: Bangalore

PostPosted: Mon Dec 22, 2008 2:38 pm    Post subject: Reply to: Scan Natural Library in Batch
Reply with quote

Thanks for your reply. I guess this will be more useful to me.

It would be great, if you could provide me some information about the PARM that are used.

IM=F,MADIO=0,MAXCL=0,AUTO=OFF,INTENS=1,PROFILE=KUKU

Or, where I can find the details about these parameters.

Thanks,
Sam
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Mon Dec 22, 2008 2:44 pm    Post subject:
Reply with quote

Description of Natural parameters could be found in Software AG's "Natural Operations for Mainframes" book. If you have a licensed Natural, you should have this book.

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

New User


Joined: 29 Sep 2008
Posts: 6
Location: Bangalore

PostPosted: Wed Dec 24, 2008 1:19 pm    Post subject: Reply to: Scan Natural Library in Batch
Reply with quote

This Worked!!
Thanks! icon_smile.gif
Back to top
View user's profile Send private message
sriramp777

New User


Joined: 29 Sep 2008
Posts: 6
Location: Bangalore

PostPosted: Tue Dec 30, 2008 11:47 am    Post subject: Reply to: Scan Natural Library in Batch
Reply with quote

Pardon for bothering once again..

Is it not possible to write the complete SCAN statement is a single line with some delimiters between, for eg,
LOGON library
SCAN!S!scan-value!replace-value!library!program-name!program-type!Y!Y

This will avoid doing any mistakes I guess.

Is there anyway, that we could write this way?

Thanks in advance,
Sam
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Dec 30, 2008 12:07 pm    Post subject:
Reply with quote

You can write batch SCAN in a keyword or delimiter flavour in one line.

However, my experience shows that Natural's SCAN is too "replace-enthusiastic", always looking for the replace-value. If your scan-value contains embedded blanks, your first word is most likely to be replaced by the second word.

Remember that Natural's SCAN replaces strings without any preliminary warning, and then issued an implicit SAVE.

To see other SCAN's syntaxes, enter Natural in an interactive mode (TSO/CICS), enter SCAN, and choose HELP (usually PF1). The syntax could be found under PF7 - "keywords".

O.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts HLIST Utility In Batch Virendra Shambharkar TSO/ISPF 4 Fri Apr 07, 2017 3:38 pm
No new posts Batch job tuning sgandhla Testing & Performance analysis 5 Fri Mar 24, 2017 9:41 pm
No new posts MIPS/CPU consumption reduction in Batch vishwakotin DFSORT/ICETOOL 4 Sat Mar 18, 2017 5:46 pm
This topic is locked: you cannot edit posts or make replies. Natural ADABAS Opening with CTS enikhilk Mainframe Jobs 0 Wed Nov 30, 2016 5:37 pm
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 5 Tue Nov 29, 2016 9:25 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us