View previous topic :: View next topic
|
Author |
Message |
sriramp777
New User
Joined: 29 Sep 2008 Posts: 6 Location: Bangalore
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
sriramp777
New User
Joined: 29 Sep 2008 Posts: 6 Location: Bangalore
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
sriramp777
New User
Joined: 29 Sep 2008 Posts: 6 Location: Bangalore
|
|
|
|
This Worked!!
Thanks! |
|
Back to top |
|
|
sriramp777
New User
Joined: 29 Sep 2008 Posts: 6 Location: Bangalore
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
|