Using MakeData to Manipulate Data

Examples of using MAKEDATA:

1) Adds or removes binary punches when using punch definitions

Example: MAKEDATA [5^2,4,6,8]Results: 2468Without a modifier, MAKEDATA blanks the receiving location before generating any data. Adds punches 2 and 4 and 6 and 8 to column 5.Example: MAKEDATA + [5^1,5]Results: 124568Adds punches 1 and 5 to column 5, leaves punches 2, 4, 6 and 8.Example: MAKEDATA - [5^1]Results: 24568Removes punch 1 from column 5, leaves punches 2, 4, 5, 6 and 8.Example: MAKEDATA [5^1]Results: 1Blanks column 5 before adding a punch 1


2) Adds or removes responses when using predefined category questions

  { COLOR:Color!FIELD,,51 Black2 Blue3 Brown4 Green5 Purple6 Red7 White(-) 8 Yellow }Example: MAKEDATA color(2,4,6,8)Results: 246Adds responses 2 and 4 and 6 and 8 to column. No error checking is done on exclusive codes.Example: MAKEDATA + color(1,5)Results: 12456Adds responses 1 and 5 to color, leaves responses 2, 4, 6 and 8. No error checking is done on the number of allowable responses.Example: MAKEDATA - color(1)Results: 24568  Removes response 1 from color, leaves responses 2, 4, 5, 6 and 8.Example: MAKEDATA color(1)Results: 1Blanks the color location before adding response 1.Example: MAKEDATA color(9)Results: 1Causes an error as 9 is not a legal color response. Leaves response 1.


3) Appends or subtracts responses when using predefined multiple response field questions

When makedata is used on multiple response field questions, additional responses are appended to the end of the current response string preserving the original order.

Subtracting a response removes it from the list and shifts the remaining responses to the left to fill the gap created.

{ FRUIT:Fruit!FIELD,,501 Apples02 Bananas03 Blueberries04 Oranges05 Peaches06 Pears07 Pineapples(-) 08 Strawberries   } Example: MAKEDATA fruit(02,04,08,06)Results: 02040806Adds responses 02 and 04 and 08 and 06 to fruit. No error checking is done on exclusive codes.Example: MAKEDATA + fruit(01,05)Results: 0204080601Attempting to add responses 01 and 05 to fruit causes an error because the number of allowable responses would be exceed. Only adds response 01, leaves responses 02, 04, 08 and 06. The order of the responses is preserved.Example: MAKEDATA - fruit(01)Results: 02040806Removes response 01 from fruit, leaves responses 02, 04, 08 and 06.Example: MAKEDATA fruit(01)Results: 01Blanks the fruit location before adding response 01.Example: MAKEDATA fruit(09)Results: 01Causes an error as 09 is not a legal fruit response. Leaves response 01.Example: MAKEDATA + fruit(01)Results: 01It is not an error to add a response that already exists.  Since duplicate responses would be an error, only one response 01 is in the fruit location.Example: MAKEDATA + fruit(02,02,05)Results: 010205Since duplicate responses would be an error, only one response of 02 is added to fruit, along with response 05. Leaves response 01.Example: MAKEDATA - fruit(07)Results: 010205It is not an error to remove a response that does not exist in the fruit location.Example: MAKEDATA - fruit(02)Results: 0105Response 01 and 05 remain. The imbedded blanks held by response 02 are removed.Example: MODIFY  [7.10$]="03  0201  "Modify the fruit location to create imbedded blanks.MAKEDATA + fruit(04)Results: 03020104A warning is issued about the imbedded blanks being removed. Adds response 04.Example: MODIFY  [7.10$]="03  020201"Modify the fruit location to create imbedded blanks and duplicate responses.MAKEDATA + fruit(05)Results: 03020105A warning is issued about the imbedded blanks being removed.  A warning is issued about duplicate responses being removed. Adds response 05. 


4) Appends or subtracts codes when using multiple locations with *f and *z

When makedata is used on multiple locations with *z (required leading zeros) and *f (no duplicate codes allowed), additional codes are appended to the end of the current code string preserving the original order.

Subtracting a code removes it from the list and shifts the remaining codes to the left to fill the gap created.

Example: MAKEDATA [17.2,...,25.2*zf#02,04,08,06]Results: 02040806Adds code 02 to the location 17.2, code 04 to the location 19.2, code 08 to the location 21.2 and code 06 to the location 23.2.Example: MAKEDATA + [17.2,...,25.2*zf#01,05]Results: 0204080601Attempting to add codes 01 and 05 to the multiple locations causes an error because the number of codes would exceed the number of available locations. Only adds code 01, leaves codes 02, 04, 08 and 06. The order of the codes is preserved.Example: MAKEDATA - [17.2,...,25.2*zf#01]Results: 02040806Removes code 01 from the locations, leaves codes 02, 04, 08 and 06.Example: MAKEDATA [17.2,...,25.2*zf#01]Results: 01Blanks all the locations before adding code 01.Example: MAKEDATA + [17.2,...,25.2*zf#01]Results: 01It is not an error to add a code that already exists. Since duplicate codes would be an error, only one code 01 is in the multiple locations.Example: MAKEDATA + [17.2,...,25.2*zf#02,02,05]Results: 010205Since duplicate codes would be an error, only one code of 02 is added to the locations, along with code 05. Leaves response 01.Example: MAKEDATA - [17.2,...,25.2*zf#07]Results: 010205It is not an error to remove a code that does not exist in the multiple locations.Example: MAKEDATA - [17.2,...,25.2*zf#02]Results: 0105Code 01 and 05 remain.  The imbedded blanks held by code 02 are removed.Example: MODIFY  [17.10$]="03  0201  "Modify the multiple locations to create imbedded blanks.MAKEDATA + [17.2,...,25.2*zf#04]Results: 03020104A warning is issued about the imbedded blanks being removed. Adds code 04.Example: MODIFY  [17.10$]="03  020201"Modify the multiple locations to create imbedded blanks and duplicate codes.MAKEDATA + [17.2,...,25.2*zf#05]Results: 03020105A warning is issued about the imbedded blanks being removed.  A warning is issued about duplicate codes being removed.  Adds code 05.