360 likes | 427 Views
More than you ever wanted to know about DATA TYPES. Dorothy Walker, Clover Park. Data types.
E N D
More than you ever wanted to know about DATA TYPES Dorothy Walker, Clover Park Data Types.ppt
Data types X any ASCII character stringU upper case ASCII string9 numeric ASCII unsigned numericZ zoned decimal numericP packed decimal numericI integer binary numericJ integer binary (for COBOL) numericK logical binary unsigned numericR floating point numeric format (HP format)F floating point scientific format (IEEE format) Data Types.ppt
Special data types are available to identify date formats: DC a day count from January 1, 1900 stored as a one or two word integerDJ a Julian date stored as a one word integer in the HP date formatDY a character date format of “YYMMDD” or “YYYYMMDD”DM a character date format of “MMDDYY” or “MMDDYYYY”DD a character date format of “DDMMYY” or “DDMMYYYY” Data Types.ppt
If a date is stored in a type that does not meet the requirements of the date data types shown above, enter an “&”. You will be prompted for the physical storage format of the date. Enter one of the following formats: YYMMDD or YYYYMMDD year-month-dayDDMMYY or DDMMYYYY day-month-yearMMDDYY or MMDDYYYY month-day-yearYYMM or YYYYMM year-monthMMYY or MMYYYY month-year Data Types.ppt
American Standard Code for Information Interchange* Dec Hex Binary Key Dec Hex Binary Key 65 41 01000001 A 66 42 01000010 B 67 43 01000011 C 68 44 01000100 D 69 45 01000101 E 70 46 01000110 F 71 47 01000111 G 72 48 01001000 H 73 49 01001001 I 74 4A 01001010 J 75 4B 01001011 K 76 4C 01001100 L 77 4D 01001101 M 78 4E 01001110 N 79 4F 01001111 O 80 50 01010000 P 81 51 01010001 Q 82 52 01010010 R *INCOMPLETE Data Types.ppt
American Standard Code for Information Interchange* Dec Hex Binary Key Meaning 0 0 00000000 ^@ NULL 48 30 00110000 0 49 31 00110001 1 50 32 00110010 2 51 33 00110011 3 52 34 00110100 4 53 35 00110101 5 54 36 00110110 6 55 37 00110111 7 56 38 00111000 8 57 39 00111001 9 *INCOMPLETE Data Types.ppt
ASCII data types Data Types.ppt
CONVERSION OR MAPPING? DATA FIELD CONVERSION/MAPPING (C/m)? [ ] This prompt will occur if there is a field of type X or U in the computational expression and the data type for the computed field is specified as a numeric type or the computational expression contains a numeric field and the data type for the computed field is non-numeric. Enter “C” to have the data converted to the new type. Enter “M” if the data stored in the field just needs to be mapped (moved). Data Types.ppt
The “mapping” situation may arise in IMAGE data bases when the data portion of a record has been defined as one string, and the contents of the record have been overlaid into this string with programs. These “hidden” fields can be mapped into computational fields when creating procedures.If mapping (rather than conversion) has been specified for a field value assignment then the Review listing will show “=>” instead of “=” to indicate that mapping will be performed on this computed field. Data Types.ppt
Generally: Take the default data type Use conversion when prompted unless You know you want the data as it is stored. Data Types.ppt
Reasons to change the data type • Matching the data type and storage length of a key field that is to be used to link one file to another. • Converting several bytes from a character string to a numeric for use in arithmetic calculations. • Creating a field with a specific data type and storage length for an undelimited ASCII output file. Data Types.ppt
Creating a key to add title to a report Data Types.ppt
Creating a key to add title to a report • Existing files in procedure----------------------------------------------------- 1: BA1290S 2: ORG-INFO-TBL-M----------------------------------------------------- Data Types.ppt
Key needs to be ORG-INDX & FYR • Data fields in MASTER data set ORG-INFO-TBL-M------------------------------------------------------------------------- 1:*ORG-INDX-KEY 9: COST-CNTR 17: RVSN-DATE 2: .OI-ORG-INDX 10: PROJ-NUM 18: .RVSN-YR 3: .OI-FYR 11: SPROJ 19: .RVSN-MO 4: TITLE 12: PROJ-PHASE 20: .RVSN-DAY 5: INDX-EDIT-STAT 13: GC-NUM 21: PURCH-EDIT-IND 6: CAMPUS 14: COUNTY-CD 22: PURCH-CNTR-ID 7: DIV 15: CITY-CD 8: DEPT 16: BDGT-ORG-INDX-------------------------------------------------------------------------ENTER DATA FIELD SELECTION 4 Data Types.ppt
BA1209S fields & TITLE from ORG-INFO –TBL-M • Define output specifications-------------------------------------------------------------------- 1: FMO 9: SSRC 17: ZERO-REC 2: FYR 10: EXP-REV-SRT 18: APPR-ORG 3: APPR 11: CURR-BDGT-AMT 19: BAL-AVAIL 4: PRG-INDX 12: FTD-BDGT-AMT 20: YEND-PROJ 5: ORG-INDX 13: FYR-BDGT-AMT 21: BALANCE 6: SOBJ 14: EMP-NAME 22: TITLE 7: SSOBJ 15: CURR-TRNS-AMT 8: SRC-REV 16: FTD-TRNS-AMT-------------------------------------------------------------------- Data Types.ppt
Computational fields to demonstrate keys that don’t work and one which does: 1) FYR is a numeric field – leading 0 is stripped. • ADD ANY COMPUTATIONAL FIELDS (N/y)? Y1) NEW FIELD NAME NOGOOD-KEY(ORG-INDX+FYR) COMPUTATIONAL EXPRESSION 5 + 2 DATA TYPE(X) FIELD STORAGE LENGTH (8) (BDBSPCORG) SALARY BUDG BY ORG & SOBJ ORG FYR-BDGT-AMT TITLE NOGOOD-KEY ----------------------------------------------------------------------------------------- 404C 30,787.00 404C203 27,920.00 404C203 <*> 58,707.00 * Data Types.ppt
2) Create a FYR field which is data type X to combine with ORG-INDX. Using conversion also strips leading 0 • 2) NEW FIELD NAME FYR-C COMPUTATIONAL EXPRESSION 2 DATA TYPE(Z) X FIELD STORAGE LENGTH (4) OCCURRENCE COUNT (1) DATA FIELD CONVERSION/MAPPING (C/m)? C Data Types.ppt
---------------------------------------------------------------------- 1: FMO 10: EXP-REV-SRT 19: BAL-AVAIL 2: FYR 11: CURR-BDGT-AMT 20: YEND-PROJ 3: APPR 12: FTD-BDGT-AMT 21: BALANCE 4: PRG-INDX 13: FYR-BDGT-AMT 22: TITLE 5: ORG-INDX 14: EMP-NAME 23: NOGOOD-KEY 6: SOBJ 15: CURR-TRNS-AMT 24: FYR-C 7: SSOBJ 16: FTD-TRNS-AMT 8: SRC-REV 17: ZERO-REC 9: SSRC 18: APPR-ORG----------------------------------------------------------------------ADD ANY COMPUTATIONAL FIELDS (N/y)? Y2) NEW FIELD NAME NOGOOD-KEY2 COMPUTATIONAL EXPRESSION 5 + 24 DATA TYPE(X) FIELD STORAGE LENGTH (8) (BDBSPCORG) SALARY BUDG BY ORG & SOBJ ORG FYR-BDGT-AMT TITLE NOGOOD-KEY FYR-C NOGOOD-KEY2 ----------------------------------------------------------------------------------------- 404C 30,787.00 404C203 203 404C203 27,920.00 404C203 203 404C203 <*> 58,707.00 * Data Types.ppt
3) Mapping preserves the leading zero. • Define output specifications---------------------------------------------------------------------- 1: FMO 10: EXP-REV-SRT 19: BAL-AVAIL 2: FYR 11: CURR-BDGT-AMT 20: YEND-PROJ 3: APPR 12: FTD-BDGT-AMT 21: BALANCE 4: PRG-INDX 13: FYR-BDGT-AMT 22: TITLE 5: ORG-INDX 14: EMP-NAME 23: NOGOOD-KEY 6: SOBJ 15: CURR-TRNS-AMT 24: FYR-C 7: SSOBJ 16: FTD-TRNS-AMT 25: NOGOOD-KEY2 8: SRC-REV 17: ZERO-REC 9: SSRC 18: APPR-ORG----------------------------------------------------------------------ADD ANY COMPUTATIONAL FIELDS (N/y)? Y3) NEW FIELD NAME FYR-M COMPUTATIONAL EXPRESSION 2 DATA TYPE(Z) X FIELD STORAGE LENGTH (4) OCCURRENCE COUNT (1) DATA FIELD CONVERSION/MAPPING (C/m)? M Data Types.ppt
Define output specifications------------------------------------------------------------------ 1: FMO 10: EXP-REV-SRT 19: BAL-AVAIL 2: FYR 11: CURR-BDGT-AMT 20: YEND-PROJ 3: APPR 12: FTD-BDGT-AMT 21: BALANCE 4: PRG-INDX 13: FYR-BDGT-AMT 22: TITLE 5: ORG-INDX 14: EMP-NAME 23: NOGOOD-KEY 6: SOBJ 15: CURR-TRNS-AMT 24: FYR-C 7: SSOBJ 16: FTD-TRNS-AMT 25: NOGOOD-KEY2 8: SRC-REV 17: ZERO-REC 26: FYR-M 9: SSRC 18: APPR-ORG ------------------------------------------------------------------ ADD ANY COMPUTATIONAL FIELDS (N/y)? Y NEW FIELD NAME ORG-TBL-KEY COMPUTATIONAL EXPRESSION 5 + 26 DATA TYPE(X) FIELD STORAGE LENGTH (8) Data Types.ppt
(BDBSPCORG) SALARY BUDG BY ORG & SOBJ ORG FYR-BDGT-AMT TITLE NOGOOD-KEY FYR-C NOGOOD-KEY2 FYR-M ORG-TBL-KEY ----------------------------------------------------------------------------------------- 404C 30,787.00 ADVISING/COUNSELING 404C203 203 404C203 0203 404C0203 27,920.00 ADVISING/COUNSELING 404C203 203 404C203 0203 404C0203 <*> 58,707.00 * 404C 47,364.00 ADVISING/COUNSELING 404C203 203 404C203 0203 404C0203 64,445.00 ADVISING/COUNSELING 404C203 203 404C203 0203 404C0203 <*> 111,809.00 * 404C 14,284.00 ADVISING/COUNSELING 404C203 203 404C203 0203 404C0203 <*> 14,284.00 * Data Types.ppt
Multi-file access order---------------------------------------------------------------------- 1: BA1290S 2: ORG-INFO-TBL-M---------------------------------------------------------------------- FILE ACCESS AND LINKAGE ORDER 1,:2 • Linking from computed to data set ORG-INFO-TBL-M---------------------------------------------------------------------- 1: ZERO-REC 5: BALANCE 9: NOGOOD-KEY2 2: APPR-ORG 6: FYR-X 10: FYR-M 3: BAL-AVAIL 7: NOGOOD-KEY 11: ORG-TBL-KEY 4: YEND-PROJ 8: FYR-C----------------------------------------------------------------------SELECT THE COMPUTED LINK FIELD 11 Data Types.ppt
(BDBSPCORG) SALARY BUDG BY ORG & SOBJ ORG FYR-BDGT-AMT TITLE NOGOOD-KEY FYR-C NOGOOD-KEY2 FYR-M ORG-TBL-KEY ----------------------------------------------------------------------------------------- 404C 30,787.00 ADVISING/COUNSELING 404C203 203 404C203 0203 404C0203 27,920.00 ADVISING/COUNSELING 404C203 203 404C203 0203 404C0203 <*> 58,707.00 * 404C 47,364.00 ADVISING/COUNSELING 404C203 203 404C203 0203 404C0203 64,445.00 ADVISING/COUNSELING 404C203 203 404C203 0203 404C0203 <*> 111,809.00 * 404C 14,284.00 ADVISING/COUNSELING 404C203 203 404C203 0203 404C0203 <*> 14,284.00 * Data Types.ppt
Conversion & Mapping Examples using CUST-ACTV-D dates • Data fields in DETAIL data set CUST-ACTV-D------------------------------------------------------------------------------- 1:*CUST-ID 14: FEE-QTY 27: YRQ 2: .CP-CUST-NUM 15: RCPT-NUM 28:*CHRG-ID 3: .CP-CUST-TYP 16: .RB-LDEV 29: CHRG-STAT 4: COL 17: .RB-CASH-SES 30: DOC-NUM 5: FEE-CD 18: .RB-RING-NUM 31: REF-DOC-NUM 6: AMT-CHRG 19: CUST-REF 32: DEBT-TYP 7: CHRG-DATE 20: .CU-REF-NUM 33: PYMT-SCHD 8: AMT-PYMT 21: .CU-REF-TYP 34: CHRG-ATTR 9: PYMT-DATE 22: ACTV-STAT 35: .CA-CHRG-ATTR1 10: PYMT-METH 23: .AB-ACTV-STAT1 36: .CA-CHRG-ATTR2 11: .PQ-PYMT-INFO 24: .AB-ACTV-STAT2 37: .CA-CHRG-ATTR3 12: .PQ-PYMT-TYP 25: .AB-ACTV-STAT3 38: .CA-CHRG-ATTR4 13: FEE-CLASS 26: .AB-ACTV-STAT4-------------------------------------------------------------------------------ENTER DATA FIELD SELECTION 6,7,8,9,27 Data Types.ppt
DataExpressCenterDefine output specifications--------------------------------------------------------------- 1: AMT-CHRG 3: AMT-PYMT 5: YRQ 2: CHRG-DATE 4: PYMT-DATE--------------------------------------------------------------- ADD ANY MORE FIELDS OR FILES (N/y)? EDIT FIELD DEFINITIONS (N/y)? ADD ANY COMPUTATIONAL FIELDS (N/y)? Y Data Types.ppt
CHRG-DATE is data type J “Convert” to type X • NEW FIELD NAME CDATE-XC COMPUTATIONAL EXPRESSION 2 DATA TYPE(J) X FIELD STORAGE LENGTH (4) 6 OCCURRENCE COUNT (1) DATA FIELD CONVERSION/MAPPING (C/m)? C Data Types.ppt
Map CHRG-DATE to X date type • NEW FIELD NAME CDATE-XM COMPUTATIONAL EXPRESSION 2 DATA TYPE(J) X FIELD STORAGE LENGTH (4) 6 OCCURRENCE COUNT (1) DATA FIELD CONVERSION/MAPPING (C/m)? M Data Types.ppt
Change PYMT-DATE to a date field • ADD ANY MORE FIELDS OR FILES (N/y)? EDIT FIELD DEFINITIONS (N/y)? Y ENTER A FIELD NUMBER 4 DATA TYPE(J+) J+& DATE SUBTYPE YYMMDD Data Types.ppt
“Convert” PMNT-DATE to data type X • ADD ANY COMPUTATIONAL FIELDS (N/y)? Y NEW FIELD NAME PDATE-XC COMPUTATIONAL EXPRESSION 4 DATA TYPE(J&) X FIELD STORAGE LENGTH (4) 6 OCCURRENCE COUNT (1) DATA FIELD CONVERSION/MAPPING (C/m)? C Data Types.ppt
“map” PMNT-DATE to type X& • NEW FIELD NAME PDATE-XM COMPUTATIONAL EXPRESSION 4 DATA TYPE(J&) X& DATE SUBTYPE(YYMMDD) FIELD STORAGE LENGTH (4) 6 OCCURRENCE COUNT (1) DATA FIELD CONVERSION/MAPPING (C/m)? M Data Types.ppt
“convert” PYMT-DATE to data type DM • ADD ANY COMPUTATIONAL FIELDS (N/y)? Y NEW FIELD NAME PDATE-DMC COMPUTATIONAL EXPRESSION 4 DATA TYPE(J&) DM FIELD STORAGE LENGTH (6) OCCURRENCE COUNT (1) DATA FIELD CONVERSION/MAPPING (C/m)? C Data Types.ppt
“map” PYMT-DATE (X&) to data type DM • NEW FIELD NAME PDATE-DMM COMPUTATIONAL EXPRESSION 4 DATA TYPE(J&) DM FIELD STORAGE LENGTH (6) OCCURRENCE COUNT (1) DATA FIELD CONVERSION/MAPPING (C/m)? MDefine output specifications-------------------------------------------------------------------- 1: AMT-CHRG 5: YRQ 9: PDATE-XM 2: CHRG-DATE 6: CDATE-XC 10: PDATE-DMC 3: AMT-PYMT 7: CDATE-XM 11: PDATE-DMM 4: PYMT-DATE 8: PDATE-XC-------------------------------------------------------------------- Data Types.ppt
(DJCONVMAP) CONVERT & MAP W/ DATE FIELDS 21-OCT-2002 (15:32) page 1 of 1 CHRG-DATE CDATE-XC CDATE-XM PYMT-DATE PDATE-XC PDATE-XM PDATE-DMC PDATE-DMM -------------------------------------------------------------------------------- 20513 20513 P! 020802 020802 QB 080202 QB 20523 20523 P+ 000000 000000 000000 20731 20731 P« 020801 020801 QA 080102 QA 20731 P« 020801 020801 QA 080102 QA 20731 P« 020801 020801 QA 080102 QA 20731 P« 020801 020801 QA 080102 QA 20805 20805 QE 020808 020808 QH 080802 QH 20807 20807 QG 020807 020807 QG 080702 QG 20807 QG 020807 020807 QG 080702 QG 20807 QG 020807 020807 QG 080702 QG 20807 QG 020807 020807 QG 080702 QG 20812 20812 QL 020816 020816 QP 081602 QP 20812 QL 020816 020816 QP 081602 QP 20812 QL 020816 020816 QP 081602 QP 20812 QL 020821 020821 QU 082102 QU 20812 QL 020821 020821 QU 082102 QU 20812 QL 020812 020812 QL 081202 QL 20812 QL 020812 020812 QL 081202 QL 20812 QL 020812 020812 QL 081202 QL 20812 QL 020812 020812 QL 081202 QL 20812 QL 020822 020822 QV 082202 QV 20819 20819 QS 020819 020819 QS 081902 QS 20819 QS 020819 020819 QS 081902 QS 20819 QS 020819 020819 QS 081902 QS Data Types.ppt
UGH! Data Types.ppt