Difference between revisions of "Creating Custom Attributes"

From Vital Soft Wiki
Jump to: navigation, search
>Jeremyb
>Jeremyb
(Gather Required Criteria)
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Summary==
 
==Summary==
 
This document will present in detail how Custom Member Attributes can be created in Vital Signs. The following files will be modified on HPUX:
 
This document will present in detail how Custom Member Attributes can be created in Vital Signs. The following files will be modified on HPUX:
- /ASKPLUS/vsdata/scripts/VSCALC-CUSTOM-ATTR
+
/ASKPLUS/vsdata/scripts/VSCALC-CUSTOM-ATTR
- /ASKPLUS/vsdata/custom/live/ICUSATTR
+
/ASKPLUS/vsdata/custom/live/ICUSATTR
- /ASKPLUS/vsdata/custom/live/ATTRFILE
+
/ASKPLUS/vsdata/custom/live/ATTRFILE
- /ASKPLUS/vsdata/custom/live/vsmacdef
+
/ASKPLUS/vsdata/custom/live/vsmacdef
  
 +
The attribute '''Three or More Services''' will be shown as a basic example.
  
 
==Gather Required Criteria==
 
==Gather Required Criteria==
The first step in creating an Attribute is to know precisely the criteria for the attribute and the datasets involved.
+
The first step in creating an Attribute is to know precisely the criteria for the attribute and the datasets involved. For this example we want to report members who have 3 or more Services.
  
 +
There already exists a common count of active shares and loans from a sdfile named SHLNTOTS. Within this dataset are 2 fields; MBR-ACTIVE-SH-CNT and MBR-ACTIVE-LN-CNT.  We have other services that are not found in share-file or loan-file but are member flags and debit cards.
 +
 +
The goal is to create a SD file storing the member account along with the count of all the related services outside of the SHLNTOTS counts.
 +
 +
''NOTE: There are macros available in /ASKPLUS/vsdata/custom/live/vsmacdef that can be used within the criteria.''
 +
Example
 +
<pre>
 +
Macro VS-ACTIVE-MBR = (MEMBER-FILE.REST-FLAG-11 <> 80 AND MEMBER-FILE.REST-FLAG-12 <> 80)
 +
</pre>
 +
 +
The following criteria will be for the member services:
 +
<pre>
 +
<< Online Banking >>
 +
%VS-ACTIVE-MBR AND MEMBER-FILE.CONTROL-FLAGS(61)=1
 +
 +
<< Direct Deposit >>
 +
%VS-ACTIVE-MBR AND MEMBER-FILE.CONTROL-FLAGS(71)=1
 +
 +
<< E-Statements >>
 +
%VS-ACTIVE-MBR AND MEMBER-FILE.CONTROL-FLAGS(76)=1
 +
</pre>
 +
 +
 +
The following criteria will be for the debit cards:
 +
<pre>
 +
%VS-ACTIVE-MBR AND
 +
ATM-FILE.TYPE-CODE = "D" AND
 +
ATM-FILE.MEMBER-STATUS = 1
 +
</pre>
  
 
==Modify VSCALC-CUSTOM-ATTR==
 
==Modify VSCALC-CUSTOM-ATTR==
 
On HPUX in /ASKPLUS/vsdata/scripts exists a file named VSCALC-CUSTOM-ATTR.  The Custom Attribute scripting will be handled within this file.  The end result should be an SD or SD Indexed file that contains fields that will be available to query in the ICUSATTR file.
 
On HPUX in /ASKPLUS/vsdata/scripts exists a file named VSCALC-CUSTOM-ATTR.  The Custom Attribute scripting will be handled within this file.  The end result should be an SD or SD Indexed file that contains fields that will be available to query in the ICUSATTR file.
  
 +
<pre>
 +
* VSCALC-CUSTOM-ATTR: Custom attribute code to create SD files needed for member attributes.
 +
* (c) Copyright Vital Soft, 2007-2009
 +
* ===================================
 +
 +
<< Create a file that will hold service entries for all Member Level Flags >>
 +
 +
NEWREG MBRSRVS1:X100
 +
MAKETEMP #MBRSRVS1
 +
 +
FIND PRIMARY=MEMBER-FILE;OUTSEL=(@);
 +
%VS-ACTIVE-MBR
 +
END
 +
 +
SAVE
 +
OUT=#MBRSRVS1, SD, DELETE, OPEN
 +
 +
S1, MEMBER-FILE.ACCOUNT
 +
NEWREG MBR-ACTIVE-SRVC-CNT:I2
 +
#MBR-ACTIVE-SRVC-CNT = 0, G1
 +
<< Count the Services for
 +
  Online Banking  : cf(61)=1
 +
  Direct Deposit  : cf(71)=1
 +
  E-Statements    : cf(76)=1
 +
  Add More As Needed >>
 +
#MBR-ACTIVE-SRVC-CNT = #MBR-ACTIVE-SRVC-CNT + 1, if (MEMBER-FILE.CONTROL-FLAGS(61)=1)
 +
#MBR-ACTIVE-SRVC-CNT = #MBR-ACTIVE-SRVC-CNT + 1, if (MEMBER-FILE.CONTROL-FLAGS(71)=1)
 +
#MBR-ACTIVE-SRVC-CNT = #MBR-ACTIVE-SRVC-CNT + 1, if (MEMBER-FILE.CONTROL-FLAGS(76)=1)
 +
T1, MEMBER-FILE.ACCOUNT, TAB1
 +
T1, #MBR-ACTIVE-SRVC-CNT, TAB2
 +
END
 +
 +
<< Create a file that will hold debit card counts for all members >>
 +
 +
FIND PRIMARY=MEMBER-FILE;OUTSEL=(@);
 +
%VS-ACTIVE-MBR AND
 +
ATM-FILE.TYPE-CODE = "D" AND
 +
ATM-FILE.MEMBER-STATUS = 1
 +
END
 +
SAVE
 +
OUT=#MBRSRVS1, SD, APPEND, OPEN
 +
S1, MEMBER-FILE.ACCOUNT
 +
NEWREG MBR-ACTIVE-SRVC-CNT:I2
 +
#MBR-ACTIVE-SRVC-CNT = 0, G1
 +
#MBR-ACTIVE-SRVC-CNT = #MBR-ACTIVE-SRVC-CNT + 1, T1
 +
T1, MEMBER-FILE.ACCOUNT, TAB1
 +
T1, #MBR-ACTIVE-SRVC-CNT, TAB2
 +
END
 +
 +
NEWREG MBRSRVS:X100
 +
MAKETEMP #MBRSRVS
 +
 +
find primary=MBRSRVS1.MBRSRVS1;
 +
end
 +
 +
SAVE
 +
OUT=#MBRSRVS, SD, DELETE, OPEN
 +
S1, MBRSRVS1.MBRSRVS1.ACCOUNT
 +
T1, MBRSRVS1.MBRSRVS1.ACCOUNT,TAB1
 +
T1, MBRSRVS1.MBRSRVS1.MBR-ACTIVE-SRVC-CNT, TAB2, COUNT
 +
END
 +
</pre>
  
 
==Modify ICUSATTR FILE==
 
==Modify ICUSATTR FILE==
 
This file will contain the Attribute criteria based on the SD file built in VSCALC-CUSTOM-ATTR.
 
This file will contain the Attribute criteria based on the SD file built in VSCALC-CUSTOM-ATTR.
  
 +
<pre>
 +
* Calculate Custom MEMBER-FILE Attributes :
 +
*
 +
*
 +
<< 3 or more services >>
 +
#ATTR(1)=( (MBRSRVS.MBR-ACTIVE-SRVC-CNT >= 3 OR SHLNTOTS.MBR-ACTIVE-SH-CNT >= 3 OR SHLNTOTS.MBR-ACTIVE-LN-CNT >= 3) OR
 +
          (MBRSRVS.MBR-ACTIVE-SRVC-CNT = 2 AND (SHLNTOTS.MBR-ACTIVE-SH-CNT = 1 OR SHLNTOTS.MBR-ACTIVE-LN-CNT = 1)) OR
 +
          (MBRSRVS.MBR-ACTIVE-SRVC-CNT = 1 AND (SHLNTOTS.MBR-ACTIVE-SH-CNT = 2 OR SHLNTOTS.MBR-ACTIVE-LN-CNT = 2)) OR
 +
          (MBRSRVS.MBR-ACTIVE-SRVC-CNT = 1 AND SHLNTOTS.MBR-ACTIVE-SH-CNT = 1 AND SHLNTOTS.MBR-ACTIVE-LN-CNT = 1) OR
 +
          (SHLNTOTS.MBR-ACTIVE-SH-CNT = 1 AND SHLNTOTS.MBR-ACTIVE-LN-CNT = 2) OR
 +
          (SHLNTOTS.MBR-ACTIVE-SH-CNT = 2 AND SHLNTOTS.MBR-ACTIVE-LN-CNT = 1) )
 +
</pre>
  
 
==Modify ATTRFILE==
 
==Modify ATTRFILE==
 
Now that the Attribute has been setup, the ATTRFILE must be updated so that the new Attribute is available in Vital Signs.
 
Now that the Attribute has been setup, the ATTRFILE must be updated so that the new Attribute is available in Vital Signs.
  
 +
For our example, the NBR will be 6 representing the sequential order of where the Attribute will display in Vital Signs.  The IDX will be 1 to match the array value in ICUSATTR #attr('''1''').  The CNT will remain blank as this Attribute is not a Product.  The Primary Topic will be '''MBRSRVS.MBRSRVS''' since that is the name of the final SD file produced in VSCALC-CUSTOM-ATTR. The INCLUDE will be '''ICUSATTR''', the Field Name will be '''TRIPLE-SERVICE''' and the Attribute Description will be '''Three or More Services'''.
 +
 +
 +
Example
 +
<pre>
 +
NBR__IDX__CNT__PRIMARY.TOPIC_________________INCLUDE___FIELD-NAME__________Attribute Description_________X
 +
1    1        SHLNTOTS.SHLNTOTS            ITOTATTR  SINGLE-SERVICE      Single Service                X
 +
2    1        MEMBRS.SHARE-FILE            ISHRATTR  ACCT-FUNDED        Sfx 0 Funded                  X
 +
3    1        MEMBRS.MEMBER-FILE            IMBRATTR  EMPLOYEE            Employee                      X
 +
4    2        MEMBRS.MEMBER-FILE            IMBRATTR  CHGOFF              Charged Off                  X
 +
5    3        MEMBRS.MEMBER-FILE            IMBRATTR  OK-TO-MAIL          OK to Mail                    X
 +
6    1        MBRSRVS.MBRSRVS              ICUSATTR  TRIPLE-SERVICE      Three or More Services        X
 +
 +
</pre>
  
 
==Enable Custom Attribute Macro==
 
==Enable Custom Attribute Macro==
Line 34: Line 152:
 
** Macro VS-CUSTOM-ATTR-XEQ = 1
 
** Macro VS-CUSTOM-ATTR-XEQ = 1
 
Macro VS-CUSTOM-ATTR-XEQ = 1
 
Macro VS-CUSTOM-ATTR-XEQ = 1
 +
</pre>
 +
 +
 +
==Verify Attributes==
 +
To verify the attributes, a full EOM extract should be run.  Once it has finished, login to Vital Signs and review the Membership_Analysis_by_ACCOUNT application Mbr Attributes tab.  If the attributes look correct, go ahead and run the Daily extract or wait for the evening run.
 +
 +
EOM example :
 +
 +
''NOTE: The CCCYYMMDD should be the last day of the prior month''
 +
<pre>
 +
login bolive
 +
cd /var/summit/spectrum/live
 +
/VSJOBS/JVSLOAD_MBRSHLN eom CCYYMMDD
 +
</pre>
 +
 +
Example Daily:
 +
<pre>
 +
login bolive
 +
cd /var/summit/spectrum/live
 +
/VSJOBS/JVSLOAD_MBRSHLN
 
</pre>
 
</pre>

Latest revision as of 21:01, 30 November 2012

Summary

This document will present in detail how Custom Member Attributes can be created in Vital Signs. The following files will be modified on HPUX:

/ASKPLUS/vsdata/scripts/VSCALC-CUSTOM-ATTR
/ASKPLUS/vsdata/custom/live/ICUSATTR
/ASKPLUS/vsdata/custom/live/ATTRFILE
/ASKPLUS/vsdata/custom/live/vsmacdef

The attribute Three or More Services will be shown as a basic example.

Gather Required Criteria

The first step in creating an Attribute is to know precisely the criteria for the attribute and the datasets involved. For this example we want to report members who have 3 or more Services.

There already exists a common count of active shares and loans from a sdfile named SHLNTOTS. Within this dataset are 2 fields; MBR-ACTIVE-SH-CNT and MBR-ACTIVE-LN-CNT. We have other services that are not found in share-file or loan-file but are member flags and debit cards.

The goal is to create a SD file storing the member account along with the count of all the related services outside of the SHLNTOTS counts.

NOTE: There are macros available in /ASKPLUS/vsdata/custom/live/vsmacdef that can be used within the criteria. Example

Macro VS-ACTIVE-MBR = (MEMBER-FILE.REST-FLAG-11 <> 80 AND MEMBER-FILE.REST-FLAG-12 <> 80)

The following criteria will be for the member services:

<< Online Banking >>
%VS-ACTIVE-MBR AND MEMBER-FILE.CONTROL-FLAGS(61)=1

<< Direct Deposit >>
%VS-ACTIVE-MBR AND MEMBER-FILE.CONTROL-FLAGS(71)=1

<< E-Statements >>
%VS-ACTIVE-MBR AND MEMBER-FILE.CONTROL-FLAGS(76)=1


The following criteria will be for the debit cards:

%VS-ACTIVE-MBR AND
ATM-FILE.TYPE-CODE = "D" AND 
ATM-FILE.MEMBER-STATUS = 1

Modify VSCALC-CUSTOM-ATTR

On HPUX in /ASKPLUS/vsdata/scripts exists a file named VSCALC-CUSTOM-ATTR. The Custom Attribute scripting will be handled within this file. The end result should be an SD or SD Indexed file that contains fields that will be available to query in the ICUSATTR file.

* VSCALC-CUSTOM-ATTR: Custom attribute code to create SD files needed for member attributes.
* (c) Copyright Vital Soft, 2007-2009
* ===================================

<< Create a file that will hold service entries for all Member Level Flags >>

NEWREG MBRSRVS1:X100
MAKETEMP #MBRSRVS1

FIND PRIMARY=MEMBER-FILE;OUTSEL=(@);
%VS-ACTIVE-MBR
END

SAVE
OUT=#MBRSRVS1, SD, DELETE, OPEN

S1, MEMBER-FILE.ACCOUNT
NEWREG MBR-ACTIVE-SRVC-CNT:I2
#MBR-ACTIVE-SRVC-CNT = 0, G1
<< Count the Services for
   Online Banking   : cf(61)=1
   Direct Deposit   : cf(71)=1
   E-Statements     : cf(76)=1
   Add More As Needed >>
#MBR-ACTIVE-SRVC-CNT = #MBR-ACTIVE-SRVC-CNT + 1, if (MEMBER-FILE.CONTROL-FLAGS(61)=1)
#MBR-ACTIVE-SRVC-CNT = #MBR-ACTIVE-SRVC-CNT + 1, if (MEMBER-FILE.CONTROL-FLAGS(71)=1)
#MBR-ACTIVE-SRVC-CNT = #MBR-ACTIVE-SRVC-CNT + 1, if (MEMBER-FILE.CONTROL-FLAGS(76)=1)
T1, MEMBER-FILE.ACCOUNT, TAB1
T1, #MBR-ACTIVE-SRVC-CNT, TAB2
END

<< Create a file that will hold debit card counts for all members >>

FIND PRIMARY=MEMBER-FILE;OUTSEL=(@);
%VS-ACTIVE-MBR AND
ATM-FILE.TYPE-CODE = "D" AND 
ATM-FILE.MEMBER-STATUS = 1
END
SAVE
OUT=#MBRSRVS1, SD, APPEND, OPEN
S1, MEMBER-FILE.ACCOUNT
NEWREG MBR-ACTIVE-SRVC-CNT:I2
#MBR-ACTIVE-SRVC-CNT = 0, G1
#MBR-ACTIVE-SRVC-CNT = #MBR-ACTIVE-SRVC-CNT + 1, T1
T1, MEMBER-FILE.ACCOUNT, TAB1
T1, #MBR-ACTIVE-SRVC-CNT, TAB2
END

NEWREG MBRSRVS:X100
MAKETEMP #MBRSRVS

find primary=MBRSRVS1.MBRSRVS1;
end

SAVE
OUT=#MBRSRVS, SD, DELETE, OPEN
S1, MBRSRVS1.MBRSRVS1.ACCOUNT
T1, MBRSRVS1.MBRSRVS1.ACCOUNT,TAB1
T1, MBRSRVS1.MBRSRVS1.MBR-ACTIVE-SRVC-CNT, TAB2, COUNT
END

Modify ICUSATTR FILE

This file will contain the Attribute criteria based on the SD file built in VSCALC-CUSTOM-ATTR.

* Calculate Custom MEMBER-FILE Attributes :
*
*
<< 3 or more services >>
#ATTR(1)=( (MBRSRVS.MBR-ACTIVE-SRVC-CNT >= 3 OR SHLNTOTS.MBR-ACTIVE-SH-CNT >= 3 OR SHLNTOTS.MBR-ACTIVE-LN-CNT >= 3) OR
           (MBRSRVS.MBR-ACTIVE-SRVC-CNT = 2 AND (SHLNTOTS.MBR-ACTIVE-SH-CNT = 1 OR SHLNTOTS.MBR-ACTIVE-LN-CNT = 1)) OR
           (MBRSRVS.MBR-ACTIVE-SRVC-CNT = 1 AND (SHLNTOTS.MBR-ACTIVE-SH-CNT = 2 OR SHLNTOTS.MBR-ACTIVE-LN-CNT = 2)) OR
           (MBRSRVS.MBR-ACTIVE-SRVC-CNT = 1 AND SHLNTOTS.MBR-ACTIVE-SH-CNT = 1 AND SHLNTOTS.MBR-ACTIVE-LN-CNT = 1) OR
           (SHLNTOTS.MBR-ACTIVE-SH-CNT = 1 AND SHLNTOTS.MBR-ACTIVE-LN-CNT = 2) OR
           (SHLNTOTS.MBR-ACTIVE-SH-CNT = 2 AND SHLNTOTS.MBR-ACTIVE-LN-CNT = 1) )

Modify ATTRFILE

Now that the Attribute has been setup, the ATTRFILE must be updated so that the new Attribute is available in Vital Signs.

For our example, the NBR will be 6 representing the sequential order of where the Attribute will display in Vital Signs. The IDX will be 1 to match the array value in ICUSATTR #attr(1). The CNT will remain blank as this Attribute is not a Product. The Primary Topic will be MBRSRVS.MBRSRVS since that is the name of the final SD file produced in VSCALC-CUSTOM-ATTR. The INCLUDE will be ICUSATTR, the Field Name will be TRIPLE-SERVICE and the Attribute Description will be Three or More Services.


Example

NBR__IDX__CNT__PRIMARY.TOPIC_________________INCLUDE___FIELD-NAME__________Attribute Description_________X
1    1         SHLNTOTS.SHLNTOTS             ITOTATTR  SINGLE-SERVICE      Single Service                X
2    1         MEMBRS.SHARE-FILE             ISHRATTR  ACCT-FUNDED         Sfx 0 Funded                  X
3    1         MEMBRS.MEMBER-FILE            IMBRATTR  EMPLOYEE            Employee                      X
4    2         MEMBRS.MEMBER-FILE            IMBRATTR  CHGOFF              Charged Off                   X
5    3         MEMBRS.MEMBER-FILE            IMBRATTR  OK-TO-MAIL          OK to Mail                    X
6    1         MBRSRVS.MBRSRVS               ICUSATTR  TRIPLE-SERVICE      Three or More Services        X

Enable Custom Attribute Macro

Once the custom attribute files are all in place and updated, the Vital Signs custom macro must be turned on.

This macro is named Macro VS-CUSTOM-ATTR-XEQ and is found in /ASKPLUS/vsdata/custom/live/vsmacdef.

Example of macro enabled:

** The following Macro is only set to 1 if custom code is to be used for this specific client.
** Custom code is added to the /ASKPLUS/vsdata/scripts/VSCALC-CUSTOM-ATTR
** Macro VS-CUSTOM-ATTR-XEQ = 1
Macro VS-CUSTOM-ATTR-XEQ = 1


Verify Attributes

To verify the attributes, a full EOM extract should be run. Once it has finished, login to Vital Signs and review the Membership_Analysis_by_ACCOUNT application Mbr Attributes tab. If the attributes look correct, go ahead and run the Daily extract or wait for the evening run.

EOM example :

NOTE: The CCCYYMMDD should be the last day of the prior month

login bolive
cd /var/summit/spectrum/live
/VSJOBS/JVSLOAD_MBRSHLN eom CCYYMMDD

Example Daily:

login bolive
cd /var/summit/spectrum/live
/VSJOBS/JVSLOAD_MBRSHLN