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

Scan Natural Library in Batch


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
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
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: 2358
Location: Israel

PostPosted: Mon Dec 22, 2008 11:53 am
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
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: 2358
Location: Israel

PostPosted: Mon Dec 22, 2008 2:44 pm
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
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
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: 2358
Location: Israel

PostPosted: Tue Dec 30, 2008 12:07 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Calling an Open C library function in... CICS 1
No new posts Help in Automating Batch JCL jobs mon... JCL & VSAM 3
No new posts Submit multiple jobs from a library t... JCL & VSAM 14
Search our Forums:

Back to Top