selection of files based on its types

Daily we are getting some datafiles to our unix server location FTPIN.

Incoming File names will be present in the location "/xyz/test/" as below:

"infile_A1_YYYYMMDD",
"infile_A2_YYYYMMDD",
"infile_B1_YYYYMMDD",
"infile_C1_YYYYMMDD"
"infile_C2_YYYYMMDD"

Where A, B and C are the different file types with the number of files (1,2,3..) for that type.

There will be a file indicator for these file types either "Y" or "N" declared in
seperate file (PCP file) as below:

export A=Y
export B=N
export C=Y

Iam executing this PCP file to setup the values before running my script.

I've to create a script to select the files which has the file indicator as "Y"
for the files types A, B and C and extract the data records from these files to a single file.

My question is how to check the file indicator for these file types which is declared in some other script
through my script? Also how to select the files which has the file type as "Y"?

Please guide me...

With Regards / Mysore Ganapati

Hi

You may trying sourcing the PCP file from within this script,so that you can access the definitions of the same.

For ksh,
. ~/yourPCPFile
For Csh
source ~/yourPCPFile

Thanks
Nagarajan G

Hi Nagaraj,

Iam executing the PCP file which has file_type declaration.
Next I've run my Unix script to select the files which has the file type as "Y". Here Iam facing the problem.
I heard using "env" we can get the environment value set during execution of PCP. but I dont know how to check which are the file types has set to type "Y" using env output.

If you can help me it would be a great help for me...

Thanks in advance / Ganapati

The values set by executing the PCP file is available only for that shell,as your shell script will spawn a new shell to execute the values exported in the PCP file are not available to the Shell script.

In your script file you need to add a line to execute the PCP file ahead of any computations based on the definitions on that PCPfile.

Thank
Nagarajan G