Highlighted
Absent Member.
Absent Member.
1468 views

How to convert correlation value to DATE format

Hi All,

I need solution for below query, please respond.

I correlated date, and it is capturing date as "11022016" (actual date: 11/02/2016), But I have to pass the parameter value like 11/02/2016. Which approach is the best way?

0 Likes
1 Reply
Highlighted
Super Contributor.
Super Contributor.

Re: How to convert correlation value to DATE format

Hi.

You'll need to use the  SaveOffset and  SaveLen paramaters in your web_reg_save_param function.  Create 3 web_reg_save_param calls (one for each dd, mm and yyyy) then concatenate the three strings using the likes of sprintf.

This should give you an idea:

Script:

//get the h3 contents:  <h3>404 - Not found.</h3>    
web_reg_save_param("test_param", "LB=<h3>", "RB=</h3>", "ORD=1", LAST);  //caputures entire string:  404 - Not found    
    
//with a result of:  404 - Not found     To extract 'Not', we start at character 6 (value for SaveOffset) and store 3 chars (value for SaveLen).
web_reg_save_param("test_param_partial", "LB=<h3>", "RB=</h3>", "ORD=1", "SaveOffset=6", "SaveLen=3", LAST);

Output:

Action.c(22): Notify: Saving Parameter "test_param = 404 - Not found.".
Action.c(22): Notify: Saving Parameter "test_param_partial = Not".

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.