Attributes are not created in .h5 file

Hi Team,

I am using the following code to create the attributes in the .h5 file but the attributes are not created.

        //Creating h5 file.
        HDFql.Execute("CREATE FILE WriteHDF5Data2.h5");

        //Creating Manditory Attributes.
        HDFql.Execute("CREATE ATTRIBUTE ITU_R_dataset AS VARCHAR VALUES(I/Q)");
        HDFql.Execute("CREATE ATTRIBUTE ITU_R_Recommendation AS VARCHAR VALUES(Rec. ITU-R SM.2117-0)");
        HDFql.Execute("CREATE ATTRIBUTE Datasettype_interpretation AS VARCHAR VALUES(Integer types, used to store I/Q data, are interpreted as fix point numbers with the radix point right to the most significant bit.)");
        HDFql.Execute("CREATE ATTRIBUTE Dataset_unit AS VARCHAR VALUES()");


        // Creating Optional Attributes
        HDFql.Execute("CREATE ATTRIBUTE Comment AS VARCHAR VALUES(I/Q Dataset describes a discrete time series of a complex valued baseband signal values.TCI Scorpio Client)");
        HDFql.Execute("CREATE ATTRIBUTE Referencepoint AS VARCHAR VALUES(Antenna output port)");

Please help us in achieving the solution.

Thanks in advance.

Hi @leelakrishna.k,

Unfortunately, the code you have posted contains two types of issues, namely:

  • when writing values using the direct value method - i.e. using VALUES(...) - these must be surrounded by " in case they contain reserved keywords, spaces or special characters. Therefore, your code should look like this as an example: HDFql.Execute("CREATE ATTRIBUTE ITU_R_Recommendation AS VARCHAR VALUES(\"Rec. ITU-R SM.2117-0\")");

  • the direct values method - i.e. VALUES(...) - must have one or more values (in other words, it cannot be empty). Therefore, your code should just be HDFql.Execute("CREATE ATTRIBUTE Dataset_unit AS VARCHAR"); when creating attribute Dataset_unit.

As a side note, it is strongly recommended to read HDFql reference manual as these rules are well described in such document.

Hope it helps!