on 02-11-2010 7:09 PM
Hi All,
We have a scenario where we sending the files to FTP with comma delimeted.
Now requirement saying that : There is a another file (called .cksum) should write no.of records , filesize, filename in 2nd file based onfirst file(File1.txt) records.
Ex :
The Checksum file contains number of records, file size and the file name .
The checksum file for file2.cksum contains the following information
1425702217 387293337 File1.txt
Please share your ideas on this , how do we achieve this 2nd file with that information.
Thanks,
Shankar
Hi,
To achieve this you have to do multimapping and then use Dynamic configuration.
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> >>To achieve this you have to do multimapping and then use Dynamic configuration.
>
> its nice idea , but in small confusion achieve this, can you elaborate some steps? for multimapping..
For multimapping steps use this blog... /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible
Now, since you already have the data type for your csv structure, so now just create the data type for checksumfile.
The data type for checkusm should be made with just one field (as per your example given for checksum values) and then use Dynamic Configuration to get the FileNmae & Filesize. For counting the records just simply use count function and count all records (use RemoveContext).
Here is the Dynamic Configuration code for FileName & size..
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","SourceFileSize");
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String fileSize = conf.get(key);
String fileName = conf.get(key1);
String output = fileSize + "" + fileName;
return output;
After counting the records just concatenate it with the output of the above udf and pass it to the target of your second mapping structure..
Rest of the steps you can see in above blog..
Regards,
Sarvesh
Hi Sarvesh,
>>Now, since you already have the data type for your csv structure, so now just create the data type for checksumfile.
>>The data type for checkusm should be made with just one field (as per your example given for checksum values) and then >>use Dynamic Configuration to get the FileNmae & Filesize. For counting the records just simply use count function and count all >>records (use RemoveContext).
here some confusion for map the source to target : my multimapping structure is like this:
target side structure :
<Messge>
--<Mesage1>
-
<Root(0:U)>
-
<Field1>
-
<Fileld2>
--<Message2>
-
<Checksum (0:U)>
-
<data>
Is this right structiure? When I test this I am able to generate 2 files, but confusion here where should i map my count funtion+ filesize+filetype?
- Shankar
> here some confusion for map the source to target : my multimapping structure is like this:
>
> target side structure :
>
> <Messge>
> --<Mesage1>
> -
<Root(0:U)>
> -
<Field1>
> -
<Fileld2>
> --<Message2>
> -
<Checksum (0:U)>
> -
<data>
>
> Is this right structiure? When I test this I am able to generate 2 files, but confusion here where should i map my count funtion+ filesize+filetype?
>
The structure looks ok. No need to make "Checksum" as 0:U. Just 0:1 will be ok.
You need to map count funtion+ filesize+filetype to "DATA" field. I couldn't understand what kind of problem you are facing? Because it is just simple.
For better understanding & explanation you can attach the screen shot of your mapping (if you still feel some confusion).
Goto Advanced Tab and invoke Adapeter specific attributes and choose message size checkbox for message size and etc., fiedls.
there is a script option. Under processing tab you have commandline option. You can use this option and put some script which does your checksum activity.
Regards
chandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Goto Advanced Tab and invoke Adapeter specific attributes and choose message size checkbox for message size and etc., fiedls.
there is a script option. Under processing tab you have commandline option. You can use this option and put some script which does your checksum activity.
I chaeked filiesize in adavanced selection , but how to write this filesize in other file?
command line option can use to achieve this, but i dont want do that..because script should placed in some folder and it is not recommended here..
Shankar
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.