RPGLE changing the output of a field - output

I have a field called FNAME which contains the first name of an employee. For my output I want to show only the first letter of their name.
For example, if their name is "Frederic" I want it to output "F" for their first name.
How would I manipulate this to get only the first letter? Do I do it with EDTWRD in my PRTF file?

EDTWRD and EDTCDE for that matter only work on numeric fields.
You'd need to substring the value.
fname = %subst(fname:1:1);

Related

Lotus Domino data as JSON - Propertie Names

I have created a custom view in my Notes database. The view has its own column headers.
Now when I get the JSON output, the object looks like this.
"#href":"\yourdatabase.nsf\/api\/data\/collections\/name\/MYVIEW\/unid\/FF235B724095ADDAC12585F300453467",
"#link":
{
"rel":"document",
"href":"\yourdatabase.nsf\/api\/data\/documents\/unid\/FF235B724095ADDAC12585F300453467"
},
"#entryid":"1-FF235B724095ADDAC12585F300453467",
"#unid":"FF235B724095ADDAC12585F300453467",
"#noteid":"1B752",
"#position":"1",
"#read":true,
"#siblings":761,
"#form":"Person",
"eName":"Doe",
"eNAM_D":"John",
"eAddress":"Mr.",
I had thought that the property names come from the column headings.
as an example:
"Name":"Doe",
"Forename":"John",
"Address":"Mr.",
instead of
"eName":"Doe",
"eNAM_D":"John",
"eAddress":"Mr.",
Is there a way to set the properties yourself?
The name used as the property name is the programmatic name of the column (check the last tab on the column properties dialog box).
This is usually the field name if the column shows just a field. It is a computed unique name e.g. $21 if the column shows something other than a field.
You can change the name of a column that does not show only a field.
In your case, you are showing a field called eName and the programmatic name is eName. You can't change this.
You can however change the column to be a computed value that isn't just a field e.g. "" + eName and then change the programmatic name. Do not change the programmatic name to the name of another field in the database.

Find the string pattern in string

I have a table called "tempData" where I have a column "rawData" in which I have text value.
E.g. - "One value is AT0001 and another value is - AT0002 in a column other might be AT0005 ok"
I want to fetch the text AT0001, AT0002, AT0005 and put it into another table as a new row.
I tried
REGEX_SUBSTR ("One value is AT0001 and another value is - AT0002 in a column other might be AT0005 ok", "AT....")
But it only return "AT0001". I want all the values.
How can I get that?
Thanks,
Atul

How do I use function field's 'glidefunction:concat' correctly in servicenow?

I have created a new field in servicenow called QI (u_qi). I want to populate this field with three other fields in other words concatenate them.
My problem is, that the field is not showing up correctly. Instead of getting names, I get random chains of numbers and letters.
Here is the configuration:
And here is what I mean by random numbers and letter:
The only field showing up correctly is the number field.
Those aren't random numbers. The number field returns the CHGxxxxxx number and the other long strings are sys_id values that reference users. You need to call getDisplayValue to get a meaningful value:
glidefunction:concat(number,',',requested_by.getDisplayValue(),',',assigned_to.getDisplayValue())

lookup in ssrs and return a value

I have a table with three columns, in column 1 I have a name and column 2 I have a quantity.
I want to look up column 1 and return the value in column 2.
I used to the expression below and it wouldn't return what I wanted.
=Lookup(fields!NAME.Value, "Paul" ,1 , 0)
Could anybody tell me what expression I need to use?
You are close, sort of. To use the Lookup function properly, you need to change some things. Here is an example using the Lookup function.
=Lookup(Fields!Field1.Value, Fields!Field1.Value, Fields!Field2.Value, "DatasetB")
It takes 4 parameters. The first is the field/value from the current (in scope) data set that you want to be the value to match in the lookup data set. The second is the field in the lookup data set to match on. The third in the field to return when a match is found, and the last parameter is the name of the lookup data set.
Based on the expression in your question, it may actually work like this:
=Lookup("Paul" , Fields!NAME.Value, Fields!QUANTITY.Value , "DataSet2")
Of course, hard coding the name in the first parameter is probably not what you want to do.

Excel country code

I have a worksheet (worksheet1) with country codes in the A column and country names in the B column. In an other worksheet (worksheet2) is a long list with the country names and other additional informations (in the same cell). How to show the country code in the B column of worksheet2 from the list in worksheet1 if the cell contains a specified country name.
I have no idea which function(s) shall I use.
If I've understood the question correctly, you have a list of countries and codes in your first sheet like this:-
And you want to do a lookup on a list of countries with additional information in your second sheet like this:-
You could try using a formula like the one shown. It does a 'FIND' with each of the countries in sheet1!b2:b5 in turn to see if any match with sheet2!a2. Then the MATCH statement picks out any which do from the resulting array, and the INDEX statement finds the corresponding country code in sheet1!a2:a5.
=IFERROR(INDEX(Sheet1!A$2:A$5,MATCH(TRUE,ISNUMBER(FIND(Sheet1!B$2:B$5,A2)),0)),"")
Must be entered as an array formula with Ctrl-Shift-Enter and pulled down as required.
If you were prepared to switch the order of the columns in worksheet1 then VLOOKUP should serve.
Without changing the sequence the very slightly less easy INDEX/MATCH combination should serve.
There are hundreds, if not thousands, of examples of both on SO.
MATCH to look for the location in your country name column, relative to the top of your range, of the country name you choose and INDEX to take that relative location and return whatever is in there within your country code column.
If your country name is within other text in the same cell (ie a substring of a longer string) there is no option but to find some means to extract it first - there is no way to match a long string to a shorter one (though shorter to longer is possible).