Joined: 27 Nov 2006 Posts: 4 Topics: 1 Location: Lisboa
Posted: Tue Nov 28, 2006 8:24 am Post subject: need help to modify file name destination in ftp
Hi,
i'm a beginner in JCL but i have a huge problem to solv.
I need to export files from IBM to Unix to load a datawharehouse. Currently i use a step like this:
//**********************************************************************
//* FTP DO FICHEIRO GFTPAGA0 *
//**********************************************************************
//FTPGPS1 EXEC PGM=FTP,REGION=4096K,COND=(4,LT)
//*STEPLIB DD DSN=TCPIP.SEZALINK,DISP=SHR
//SYSTCPD DD DSN=TCPIPP.CONFIG(TCPDATAP),DISP=SHR
//SYSFTPD DD DSN=TCPIPP.CONFIG(FTPDATAP),DISP=SHR
//INPUT DD *
1.2.3.4
xpto
otpx
cd mydir
PUT 'PSIG.DW.SPTCACT0.DWHOUSE.TEMP' SPTCACT.dat
close
end
//OUTFILE DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
/*
What i would like to do is change the file name of the destination file by adding a numeric value stored
in a DB2 table or in a dataset. This value would be increased and updated each time the job run.
In the previous job that would be replacing de "SPTCACT.dat" name with "SPTCACT001.dat" at runtime.
After next execution the output would be "SPTCACT002.dat" and son on.
Can any one help me ?
Joined: 27 Nov 2006 Posts: 4 Topics: 1 Location: Lisboa
Posted: Tue Nov 28, 2006 1:28 pm Post subject:
I have tried the FTP with "StoreUnique (SU)" option. It does not solv my problem because, after loading
the data into the warehouse, i move the file from the destination directory to a backup directory. The SU
option needs to find the same file name in the remote server directory.
Besides i need all the file names to be unique since the first extraction.
Thanks, anyway!
The resulting output is "FILE.200611&SEQ..TXT" and i would like it to be "FILE.200611001.TXT".
The 0001 is the value stored in COUNTER_NUM field of my table.
It is not possible to pass a value from a variable to another variable through steps ?
Joined: 26 Nov 2002 Posts: 12401 Topics: 75 Location: San Jose
Posted: Thu Nov 30, 2006 9:19 pm Post subject:
jalves,
there is no symbolic to increase the seq number. You need to store the file as unique. so I suggested to use the date , time as part of the filename so that they are unique
Joined: 27 Nov 2006 Posts: 4 Topics: 1 Location: Lisboa
Posted: Fri Dec 01, 2006 5:23 am Post subject:
kolusu,
i'm not concerned about increasing the seq number any more. I can do that with a select statement or a REXX program.
What i'm asking, to you or anyone, is some help to find out why the output of the previous job does not use the
value stored in SEQ variable inside the CMD variable, or if there is another way to do it.
I understand you must have better things to do but allow me to tell you the all story.
Each time our datawarehouse extraction process executes, the unix server receives data files with the newest
information stored in the online database. Due to several problems sometimes we must execute the DW loading
processes manually. Thats when, once in a while, the order of the files is confused and our DW database
becomes inaccurate. To solve this we intend to change our programs in order to keep track of the next file number
to be loaded. Programs will not process file 3 if they are expecting file 2. Thats why we can't use date and time in
file names. Our programs need to know the name of the correct datafile to be loaded next.
Any ideas ?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum