Fri Sep 17, 2021 10:44 am
Login Register Lost Password? Contact Us


[Tut] fpos and __fileposition__ are different

Topics specific to the use of the ECL IDE

Wed Jan 07, 2015 7:05 pm Change Time Zone

Hi,

I worked through the Tutorial 'till "Index the Data", now i recognized, that fpos != __fileposition__ ? Are they not the same?



Dataset_PrepareIndex_Zip
Code: Select all
Import Tutorial;

EXPORT Dataset_PrepareIndex_Zip :=
      DATASET   ('~tutorial::myname::upperperson',
                  {Tutorial.Layout_People, UNSIGNED8 fpos {virtual(fileposition)}},
                  THOR);



Process_AllPeopleToUpper
Code: Select all
IMPORT Tutorial, STD;      //Std = Standard Library

   Tutorial.Layout_People AllPeopleToUpper(Tutorial.Layout_People rawInput) :=
      TRANSFORM
         SELF.FirstName := STD.Str.ToUpperCase(rawInput.FirstName);
         SELF.LastName := STD.Str.ToUpperCase(rawInput.LastName);
         SELF.MiddleName := STD.Str.ToUpperCase(rawInput.MiddleName);
         SELF.Zip := rawInput.Zip;
         SELF.Street := rawInput.Street;
         SELF.City := rawInput.City;
         SELF.State := rawInput.State;
      END;
      
OrigDataset := Tutorial.Dataset_OriginalPerson;
NewDataset := PROJECT(OrigDataset,AllPeopleToUpper(RIGHT));
OUTPUT(NewDataset,,'~tutorial::myname::UpperPerson',OVERWRITE);
NSD
 
Posts: 20
Joined: Sat Nov 15, 2014 10:18 am

Thu Jan 08, 2015 12:02 pm Change Time Zone

Ive fixed this:

In a previous tutorial, there was a Record Length of 155 of the OriginalPerson File, now it is 124. My question is now: how do i know the exact Record Length of a File?
NSD
 
Posts: 20
Joined: Sat Nov 15, 2014 10:18 am

Thu Jan 08, 2015 2:42 pm Change Time Zone

NSD,

You're confusing the "Persons" file from our Introduction to ECL online eLearning course (155-byte records) with the "OriginalPerson" file from the Data Tutorial downloadable PDF (which has 124-byte records).
how do i know the exact Record Length of a File?
The answer to this is the same as in any other language/development platform -- you either are given that information from the data provider, or you need to empirically determine it for yourself.

In the case of our ECL teaching materials, we will always give you enough information up front to be able to work with the file.

HTH,

Richard
rtaylor
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1593
Joined: Wed Oct 26, 2011 7:40 pm

Thu Jan 08, 2015 3:51 pm Change Time Zone

thank you. ill work through more tutorials :)

in my case i will only work with CSV's. as i remeber right, i hadn't set up a record length.

for anybody, who's interested how it works:

http://www.unix.com/unix-for-dummies-qu ... -file.html
NSD
 
Posts: 20
Joined: Sat Nov 15, 2014 10:18 am


Return to ECL IDE

Who is online

Users browsing this forum: No registered users and 1 guest

cron