Batch-CATALL

Hello all!

Is it possible to do a batch catall?
My first try under LINUX-Environment:

lib=TEST
prog='DW*'
natural batch parm=natparm bp=natbp etid=id$$ stack="(logon $lib; catall $prog; fin)"

But this is not working. I have to press ENTER, before catall starts.

Sorry for my quick reply, but I got a sudden inspiration:

I wrote a natural program CATTEST with the following content:

define data local                                               
01 #LIB  (A8)                                                   
01 #PROG (A8)                                                   
end-define
INPUT #LIB #PROG                                               
STACK TOP DATA #PROG '*' '*' '*' '*' '*' '*' '*' '*' '*' '*' '*'
STACK TOP COMMAND 'CATALL'                                     
STACK TOP COMMAND 'LOGON' #LIB
END

Then I have to call on System-Level:


lib=TEST
prog='DW*'
natural batch parm=natparm bp=natbp etid=id$$ stack="(logon $lib; cattest $lib $prog; fin)"

But it would be fine if anybody could preset a solution without a natural program. That would be much proper…

I don’t think there is one, you won’t get rid of that popup in batch-simulation mode, and CATALL doesn’t work in “real batchmode”.

Hi,

I need something like this post, but I have several libraries and objects to be cataloged, but I cannot use catall *, because there are many other objects in the libraries and I dont want to have any changing on the rest of the objects; I need CTL file.

I did a similar program, but it seems that the objects are cataloged, but when there are any errors, nothing is written in the CTL file. If I have just one lib and object, and there is a error, the information is written on CTL file.

Does anyone know how to solve it?

tks.

Hi,

according to my test, the catall process is working as it should, the problem is that CTL file is replaced for each value of object, but the objects are cataloged. As I need CTL file for my control, I think that the best idea is to unload the objects to a new library, to use the catall process, and then to move the objects to the correct library. Only this way I can have the complete CTL file.

If someone have any other suggestion or idea, it would be great.

tks.

Do you mean that you need the audit trail?

Invoke Natural once for each library and concatenate the CMPRINTs.

natural BATCHMODE cmprint=CMPRINT1
LOGON lib1
CATALL object1
CATALL object2

natural BATCHMODE cmprint=CMPRINT2
LOGON lib2
CATALL module1
CATALL module2

CAT CMPRINT1 CMPRINT2 > CMPRINT

Hi,

I am afraid to say but it didnt work. Have you already executed it before?

I have a sequencial file with objects and libraries names. So, I need to catalog one by one, and I also need to have CTL file to check after if it is ok or not. I am understanding that each time that Catall is issued, the CTL file is replaced.

tks.

This worked for me. It appears that the Natural LOGON re-opens CMPRINT. Invoking Naturakl for each library lets us copy/concatenate CMPRINT before Natural overwrites it. It will work equally well whether you specify one or multiple CATALLs per step.

#!/bin/bash

export dir=xxx
export report=Zbrog.report
export CMPRINT=Zbrog.cmprint
export temprpt=Zbrog.temp

export CMSYNIN=xxx
echo LOGON lib1          > $CMSYNIN
echo CATALL DSUBR CHECK >> $CMSYNIN
echo CATALL DSUBP CHECK >> $CMSYNIN
echo FIN                >> $CMSYNIN
natural BATCHMODE parm=ZBROG cmsynin=$CMSYNIN cmobjin=$CMSYNIN cmprint=$CMPRINT NATLOG=OFF
cp  $report  $temprpt
cat $temprpt $CMPRINT > $report

export CMSYNIN=xxx
echo LOGON lib2          > $CMSYNIN
echo CATALL DPROG CHECK >> $CMSYNIN
echo CATALL DUPL  CHECK >> $CMSYNIN
echo FIN                >> $CMSYNIN
natural BATCHMODE parm=ZBROG cmsynin=$CMSYNIN cmobjin=$CMSYNIN cmprint=$CMPRINT NATLOG=OFF
cp  $report  $temprpt
cat $temprpt $CMPRINT > $report

rm $CMSYNIN 
rm $CMPRINT
rm $temprpt

The output looks like this:

NEXT LOGON lib1
Logon accepted to library lib1.
NEXT CATALL DSUBR CHECK
                                                                                                                                                                                                                                                                
Library lib1
CATALL DSUBR,CHECK
Object                               Error   Error-line
------------------------------------ ------- ----------
                                                                                                                                                                                                                                                                
Number of objects cataloged: 0001
Number of errors detected: 0000
NEXT CATALL DSUBP CHECK
                                                                                                                                                                                                                                                                
Library lib1
CATALL DSUBP,CHECK
Object                               Error   Error-line
------------------------------------ ------- ----------
DSUBP                                0082    0020                               
                                                                                                                                                                                                                                                                
Number of objects cataloged: 0001
Number of errors detected: 0001
NEXT FIN
NAT9995 Natural session terminated normally.
NEXT LOGON lib2
Logon accepted to library lib2.
NEXT CATALL DPROG CHECK
                                                                                                                                                                                                                                                                
Library lib2
CATALL DPROG,CHECK
Object                               Error   Error-line
------------------------------------ ------- ----------
DPROG                                0082    0020                               
                                                                                                                                                                                                                                                                
Number of objects cataloged: 0001
Number of errors detected: 0001
NEXT CATALL DUPE CHECK
                                                                                                                                                                                                                                                                
Library lib2
CATALL DUPE,CHECK
Object                               Error   Error-line
------------------------------------ ------- ----------
NAT4867 Nothing found for this request.
NEXT FIN
NAT9995 Natural session terminated normally.

Hi Ralf,

the result is a little bit different than CTL file, but it could be this way, however, when I have any error (there is an object with a syntaxe error), I receive NAT4867, as you receive when the object doesnt exist in the library. I have double checked it, and the object exist. - if I catalog it online, it works. Any idea what is wrong?

tks.

Yes, I’ve experienced the NAT4867, but I can’t explain it. Today I re-ran my script, having made no changes to it, and it worked. That is, it found module DUPE.

hi,

according to some problem posted at empower, nat4867 would be solved in previous nat versions; however, I think it was not solved it. Do you think that it is still a bug? Is there any workaround?

tks.