|
|
| נשלח ב-28/7/2008 13:39 |
|
| |
להגיד ששלמה - החכם מכל אדם התעסק בשטויות כמו פיזיקה גרעינית
זה זלזול נורא !
גורו לכם מיום הדין!!
_________________
כל תלמיד חכם שאינו נוקם ונוטר כנחש אינו תלמיד חכם. הנקמה היא מעדן שנאכל כשהוא קר (מקיאוולי).
|
|
|
|
| נשלח ב-28/7/2008 13:41 |
|
| |
COBOL Comp-3 Packed fields:
<>*-- Table on right that says "Need to convert Packed fields?" * >
Need to convert Packed fields?
That's our business! |
This page discusses how data is stored in COBOL "comp-3", or "packed" fields.
COBOL "Comp-3", also called "Computational-3", "Packed Decimal", or "Packed"
(See note 1 about terminology)
COBOL Comp-3 is a binary field type that puts ("packs") two digits into each byte, using a notation called Binary Coded Decimal, or BCD. This halves the storage requirements compared to a character, or COBOL "display", field. Comp-3 is a common data type, even outside of COBOL, and is fairly standard across platforms -- that is, it is not dependent upon the operating system, language, or CPU, as the COBOL "comp" is. (See COBOL Computational Fields). However, comp-3 is not commonly found in PC languages.
How the data is stored
The Binary Coded Decimal (BCD) data type is just as its name suggests -- it is a value stored in decimal (base ten) notation, and each digit is binary coded. Since a digit only has ten possible values (0-9), it can be represented in binary form with only 4 bits. Four bits is called a "nybble", and each nybble contains one digit of the value. Therefore, you can get two digits in each 8 bit byte. (There's an example below). Normal character representation only stores one character (digit) per byte, so packed data only requires half the storage of unpacked (character) data. (See Character, BCD, and Binary Fields if this deion is not clear.)
The value in a comp-3 field is stored high-order to low-order. That is, the upper nybble of the first byte encountered in the file is the most significant digit of the value, the lower nybble of that byte is the next digit, etc., etc. The last nybble -- the low nybble of the least significant byte -- is used to store the sign for the number. Unlike IBM Signed fields (see EBCDIC to ASCII Conversion of Signed Fields), this nybble stores only the sign, not a digit. "C" hex is positive, "D" hex is negative, and "F" hex is unsigned. In COBOL comp-3 fields (and in most other languages) this nybble is reserved for the sign whether or not the field is denoted as a signed field in the COBOL PIC.
Comp-3 packed fields are aligned on byte boundaries, and the field is always a whole number of bytes. The sign nybble is always the low nybble of the LSD (least significant digit). Since the sign takes one nybble, and because there are always an even number of nybbles in any number of bytes, an odd number of digits will fully-fill any size comp-3 field. (An odd number of digits plus a sign nybble makes an even number of nybbles, or fully-filled bytes). If the size of the field is specified as an even number of digits, as in "PIC S9(6) comp-3.", the upper nybble is ignored and is usually, but not always, set to zero. You might say the field is "right aligned".
Comp-3 fields in COBOL
Comp-3 fields are denoted in COBOL with the "usage is" clause after the PIC, like this:
PIC S9(5) usage is computational-3.
However, the "usage is" is not required and seldom used, and "computational-3" is usually abbreviated "comp-3", so you more commonly see:
PIC S9(5) comp-3.
The COBOL PIC, or picture, for a comp-3 packed field specifies the number of digits after unpacking. The actual number of bytes occupied in the file is about half that. To calculate the number of bytes from the PIC, add 1 (for the sign) to the total number of digits, divide by 2, and round up if necessary. For example:
PIC S9(7) COMP-3. Byte size = (7 + 1) / 2 = 4
PIC S9(5)V99 COMP-3. Byte size = (5 + 2 + 1) / 2 = 4
PIC S9(6) COMP-3. Byte size = (6 + 1) / 2 = 3.5, rounded to 4
Comp-3 fields reserve a nybble for the sign, even for "unsigned" values, so the following fields are still 4 bytes:
PIC 9(7) COMP-3. Byte size = (7 + 1) / 2 = 4
PIC 9(6) COMP-3. Byte size = (6 + 1) / 2 = 3.5, rounded to 4
Examples
Lets look at some examples of how comp-3 data is stored. The left column in the table below is the decimal value being stored, and the right column is the hexadecimal value you will see in the file:
Value Comp-3, hex
+0 0C
+1 1C
+12 01 2C
+123 12 3C
+1234 01 23 4C
-1 1D
-1234 01 23 4D
Each underlined value above represents one byte, in hexadecimal (hex) form. We have only used as many bytes as needed to store the value shown on the left.
When you "unpack" a packed, or comp-3, field, the size of the field will double. This will cause all fields following it to shift down. If the field is in a redefined area, it will likely no longer fit in the allocated space, and the original field it redefined will have to be modified, or filler will have to be added, to accommodate the larger unpacked field. When there are multiple levels of redefined fields, this can make for a messy situation.
Additional information
A comp-3 field may also have an implied decimal.
For a more verbose explanation of BCD and binary fields, see Character, BCD, and Binary Fields.
For further discussion of other COBOL data types, see COBOL Computational Fields, and EBCDIC to ASCII Conversion of Signed Fields.
And for more complete information on COBOL files, see Reading COBOL Layouts.
For more articles on data conversion, see our TechTalk Index.
Our COBOL Conversion Services
Disc Interchange Service Company employs a number of methods to convert Packed fields. We have written several utilities to efficiently unpack simple files. For more complex files we work with three COBOL compilers. We can accept your data in EBCDIC or ASCII, on tape, disk, or electronically, and return your converted files in whatever format you prefer.
With over 24 years of experience with thousands of files, we have the knowledge and methods to catch problems with the data before they cause you grief.
|
|
|
Note 1: There is considerable ambiguity and confusion over the terms "packed" and "comp-3". Although the terms are pretty standardized in COBOL, they may mean something different in another language.
Although a vendor could use "comp-3" to describe a different type of field, "comp-3" almost always means the definition given on this page, in all languages, and on all platforms, even PCs. "Packed", however, when used by other languages often means something different than (although similar to) the COBOL definition. For example, "packed" sometimes describes a BCD field with no sign.
The bottom line is this: If you are reading a COBOL layout these fields are always called "comp-3" or "computational-3". If you are reading a non-COBOL layout, the term "packed" frequently means comp-3, but is occasionally used to denote other kinds of packed fields.
Disc Interchange Service Company, Inc.
Media Conversion Specialists
15 Stony Brook Road
Westford, MA 01886
(978) 692-0050
Copyright © 1997 - 2007 by Disc Interchange
All rights reserved. See our copyright page.
תוקן על ידי דורש_אמת ב- 28/07/2008 13:45:31
|
|
|
|
| נשלח ב-28/7/2008 13:45 |
|
| |
דורש אמת
א. צריך לשים לב, שהרבה דברים יכולים להתפרש בכמה אופנים, וקשה להסיק ישירות מפסוק מסויים. "וידבר על העצים" וכו', יכול להתפרש למשל, שמשם היו לקוחים משליו. כמובן, זה מראה על הבנה מסויימת בעניין, אבל זה לא בהכרח שיא החכמה. זה יכול להתפרש גם, אם ניקח את מה שאמרו שהוא נמלך על החיות, שהוא ידע איך לשפוט בין החיות, כמו הסיפור על דוד שהפריד בין הצאן הזקנות לצעירות.
ב. עדיין, לאן נעלמה ירידת הדורות?
|
|
|
|
| נשלח ב-28/7/2008 13:49 |
|
| |
מיכה
א. אם תסתתכל בתלמוד אנני זוכר אם בב"ב או בסוכה שמובא על ר יוחנן בן זכאי שידע שיחת עופות ודקלים תראה שם את הכוונה בשיחת חיות ועופות.
ב. לא הבנתי את השאלה?
|
|
|
|
| נשלח ב-28/7/2008 13:49 |
|
| |
DFL
The format is specified by using the USAGE IS clause.
There are four formats:
DISPLAY zoned decimal number
1 character/byte
default
COMP-3 packed decimal number
2 digits/byte - last byte contains the sign digit
COMP binary number
S9 to S9(4) - stored as 2 bytes
S9(5) to S9(9) - stored as 4 bytes
S9(10) to S9(18) - stored as 8 bytes
NOT aligned on a specific boundary
also known as COMP-4
COMP SYNC binary number on a specific boundary
S9 to S9(4) - stored as 2 bytes on halfword
S9(5) to S9(9) - stored as 4 bytes on fullword
S9(10) to S9(18) - stored as 8 bytes on fullword
01 FLD-A PIC S9(5) USAGE IS DISPLAY.
01 FLD-B PIC S9(5) COMP-3.
01 FLD-C PIC S9(5) COMP.
01 FLD-D PIC S9(5) USAGE IS COMP SYNC.
Using COMP SYNC can cause "slack bytes" to be embedded within the WORKING STORAGE because of the forced alignment. This can affect questions as to the size of table entry, or computing the size of a record.
Anything on an 01 level is automatically on a doubleword boundary.
COBOL performs the conversions between numeric formats automatically.
Usage guidelines:
DISPLAY numerical items that will not be used for arithmetic and
will be printed
COMP-3 numerical items that will be used in arithmetic and
will eventually be printed
COMP numerical items that will be used ONLY for arithmetic and
will NOT be printed
01 FLD-A PIC S9(5) USAGE IS DISPLAY VALUE 23.
stored as 5 bytes: F0 F0 F0 F2 F3
01 FLD-B PIC S9(5) COMP-3 VALUE 23.
stored as 3 bytes: 00 02 3F
01 FLD-C PIC S9(5) COMP VALUE 23.
stored as 4 bytes: 00 00 00 17
 |
|
|
|
|
| נשלח ב-28/7/2008 14:00 |
|
| |
א. מה שכתוב בחז"ל זה לא אומר, כי אתה עצמך אמרת שהם ידעו מה שלא ידעו בזמן הנביאים.
ב. אם יש ירידת הדורות, כלומר ככל שהדור מאוחר יותר - כך הוא מבין פחות בכל תחום, אם כן איך זה שהנביאים לא יכלו להשיג מה שהשיגו התנאים?
|
|
|
|
|
| נשלח ב-28/7/2008 14:13 |
|
| |
בתגובה לדברי דורש_אמת מיום 28/7/2008 שעה 13:41 "ולכן הספרה "8" במסך, היצוג הפנימי יהיה שונה לפי הגדרת הטיפוס" לא מניה ולא מקצתיה. כל הצטוט אינו רלבנטי. היצוג של "8" בזכרון, לפני תצוגה, יהיה 'x'F8, או 11111000 עוד 65 ימים לכל היותר עד להגעת המשיח, על פי תקשור דניאל
|
|
|
|
| נשלח ב-28/7/2008 14:17 |
|
| |
מקובלנו מזקנינו, שמי שמשלב בהודעותיו קטעים שלמים מחוברות טכניות, חזקה עליו שהוא רגיל ובקיא באומנותו. אלא שבמקרה דנן, באופן חריג ואף תקדימי, מסתבר שייתכן שגם הדיוט שחיפש קצת בגוגל, יכול לנסות להתחזות למומחה באמצעות אותו אקט מרשים של העתק/הדבק.
איפשהו, לפני 20 ומשהו עמודים, שאל דורש אמת את בר הפלוגתא שלו, איך מיוצג הסיפרה "8" בזכרון המחשב. עכשיו, אחת מן השתיים: או שיש לשאלה תשובה מוגדרת, או שאין לה. אם מדובר בשאלה עם תשובה מוגדרת, היא חייבת להתייחס לייצוג הבינארי של ערך הסיפרה "8" לפי תקן מקובל, כמו ASCII (דורש התהדר כאן גם באבחנה בין ASCII 7 ו-8 ביט, שהיא כמובן חסרת משמעות למספרים מתחת ל-127, אבל כוס הלעג כבר מלאה כך שאין נ"מ). הייצוג הבינארי של מספר, הוא תלוי ארכיטקטורה. אי לכך, כל הקונבנציות של קומפיילר כזה או אחר וכל ההתאמות לפלטפורמה זו או אחרת, אינן רלוונטיות לשאלה. זה כמובן לא אמור להיות נהיר למי שמכיר את הנושא דרך חיפושי גוגל והדבקות של שברי הסברים, אבל זה בסיסי למי שבאמת עוסק בתוכנה.
כמובן שכל תוכנה רשאית לאמץ לעצמה מוסכמות ולעבוד עם מבני נתונים משלה, אבל אז השאלה הופכת להיות חסרת משמעות (בדיוק כמו ביטויים כמו "חכמה פנימית"). הרי אם לא מדובר על סטנדרטים, אלא על בחירה של תוכנה מסויימת בייצוג מסויים, יש אינסוף דרכים לייצג מספר. אפשר לצייר אותו, אפשר לאכסן אותו ב BCD, אפשר לקדד אותו כאינדקס לתוך מערך מספרים וכו' וכו'. יש משהו מאלף בחלק הזה של הויכוח, משום שגם בו, למרות שמדובר בתחום קונקרטי שבו אי אפשר להסוות את השקר והבורות, דורשאמת לא יכול להיגמל מההתמכרות שלו לעירפול. הוא חותר לאותו תיקו מכובד של מי שאומר "אי אפשר להוכיח ששלמה המלך לא המציא את בארט סימפסון". הוא שאל שאלה שאת התשובה שלה לא ידע. עכשיו, בדיעבד, הוא מנסה להסביר שמדובר בשאלה שאין לה תשובה חד משמעית, כך שאי אפשר להוכיח שאין לו מושג. אבל דווקא אפשר. ואין לו.
 |
|
|
|
|
| נשלח ב-28/7/2008 14:40 |
|
| |
DFL
עיון מחודש בסמל משפחת המלוכה הבריטית ילמד אותך, שהקישור בין בארט סימפסון לשלמה המלך אינו מופרך...
_________________
אוי לשכן
ואוי לשכנו
|
|
|
|
| נשלח ב-28/7/2008 15:32 |
|
| |
DFL
אתה מערב בין קוד ASCII לבין יצוג ספרות במחשב.
המחשב יכול לייצג ספרות בכמה צורות והקומפייילר מחליט איך לאכסן .
ולכן יתכן שהספרה 8 תוצג ב ASCII בתו לא מוכר.
אני לא ראוה טעם להמשך הויכוח עם חוסר יושר האיטלקטואלית שלך.
אתה פשוט לחוץ שאולי בכל זאת טעית................
ולכן כל מה שהבאתי הוא תיאור נכון למה שאמרתי.
רק נראה לי שאתה בכח רוצה לומר שאני לא מבין תמשיך בכך .
מיכה
א. חז"ל מסבירים את המשמעות של דיבור אל העצים והאבנים.
ב. הזהר מחדש שנתגלו לו דברים שלא ידעו קודם , כך מצוטט בזהר .
ואם תשאל אותי אם כן גם נאמר כך בחכמה חיצונית , ועל זה אני אומר על שלמה המלך נאמר שלא יהיה חכם כמוהו ,והכוונה גם חוכמות חיצוניות, ולכן שלמה ידע את כל החוכמות החיצוניות וכמו כן משמע שהתנאים ידעו הרבה.
לגבי תורת הנסתר לא כתוב שלפני הזהר מישהוא ידע הכל.
הרי הגמרא מביאה שמשה ראה את ר עקיבא דורש על כל קוץ וקוץ , חלשה דעתו של משה עד ששמע הלכה למשה מסיני, הרי שהגמרא עצמה אומרת שהפרטים של החכמה הפנימית נתגלו מאוחר יותר על סמך הכללים שנלמדו למשה בסיני , אבל הפרטים נתגלו מאוחר יותר.
אבל בחוכמות חיצוניות נאמר על שלמה שכמוהו לא יהיה.
כך הדברים נראים לפי הבנתי.
יתכן ואין הוכחה חד משמעית , אבל אפשר להסיק מכך שמי שאומר ששלמה ידע הכל אינו מן המתמיהין.
גוברנור
נכון שאתה שם את ה"8" כתו , אבל שאלתי היתה כזאת:
במסך גם הספרה 8 מיוצגת כ "8" , ולכן אני שאלתי על "8" איך שמיוצג במסך , אבל לא כל "8" במסך הוא "8" בזכרון. אלא כמו שהבאתי מהחומר הטכני.
_________________
תוקן על ידי דורש_אמת ב- 28/07/2008 15:32:52
 |
|
|
|
|
| נשלח ב-28/7/2008 15:34 |
|
| |
1. אני חושב שזה מגוחך לחשוב ששלמה ידע פיסיקה מודרנית, בערך כמו שזה מרושע ללגלג על משתמשים אחרים.
2. במציאות אין דבר כזה "8". "8" זה ייצוג אבסטרקטי בתודעתו של האדם לכך שמשהו מופיע שמונה פעמים במציאות החצונית לו, אותה הוא קולט בחושים. במציאות, פעולות המחשב אינן שונות מהותית מנפילת אבן, ואינן שונות עקרונית מנפילת קובויות דומינו שסודרו בשורה על ידי בן אדם.
|
|
|
|
| נשלח ב-28/7/2008 16:00 |
|
| |
דורש, קראתי קטעים בודדים מהשיח. חשוב שתבין שנוסחאות הן דרך מקוצרת לסכם בצורה קצרה ומוכללת את הידע על העולם, כפי שהאדם מבין אותו.
המחלוקת בינכם מבוססת על השאלה האם יתכן שיש לאדם דרך נוספת לקבל ידע על העולם- מלבד החושים שלו. אתה מאמין במיסטיקה (=מאמין שלאדם יש מקורות ידע נוספים זולת החושים), ואין דרך לגשר על זה. אדם שמעוניין לחיות בעזרת שיכלו- נוטה לא לקבל את זה.
זה שתשים את זה תחת הכותרת "חוכמות חיצוניות"- לא יוסיף לך כבוד, שכן מדובר על השאלה "מה היא האמת?" אם לא שמת לב- האמת היא שאתה אינך יודע מה הוא קוד האשראי של גוברנר, וששלמה לא ידע לנחש את מחשבותיו של דוד.
|
|
|
|
| נשלח ב-28/7/2008 16:11 |
|
| |
בתגובה לדברי דורש_אמת מיום 28/7/2008 שעה 15:32 "נכון שאתה שם את ה"8" כתו , אבל שאלתי היתה כזאת: במסך גם הספרה 8 מיוצגת כ "8", ולכן אני שאלתי על "8" איך שמיוצג במסך, אבל לא כל "8" במסך הוא "8" בזכרון. אלא כמו שהבאתי מהחומר הטכני" במחשב שלי, "8" ערוך לתצוגה, מיוצג כ- 'x'F8 הקוד הפנימי הוא EBCDIC, ולא BCD עוד 65 ימים לכל היותר עד להגעת המשיח, על פי תקשור דניאל
|
|
|
|
| נשלח ב-28/7/2008 17:21 |
|
| |
מסקרן אותי מאד- אם אשכול זה ימשך עוד 65 יום? או עד שמשיח יבא? המאוחר שביניהם?
_________________
מודה ועוזב
|
|
|
|
| נשלח ב-28/7/2008 22:26 |
|
| |
דורש אמת
א. חז"ל מסבירים, ואנחנו לא חייבים להסכים איתם. עיין שוב ברשב"ם בתחילת פרשת וישב פסוק ב' על המילים "אלה תולדות יעקב".
גם אם נקבל את ההסבר שמדובר בחכמת הטבע,
1. האם גם בזה הוא היה חכם מכל אדם? אולי רק בחכמת המשפט הוא היה חכם מכל אדם ובשאר החכמות הוא היה סתם חכם?
2. גם אם נאמר שהוא היה חכם מכל אדם גם בשאר חכמות - האם משמעות הדבר שהוא ידע גם חכמות - שלכאורה, נתחדשו רק בימינו? עיין בדברי לנישטאיך בעמ' הקודם.
ב. ראה סעיף א'.
אם בחכמת הנסתר יש עליית הדורות, ובחכמת הטבע יש תזוזות לא ברורות כאשר השיא, נניח נמצא אצל שלמה המלך (אגב הרמב"ם אומר שהמשיח יהיה חכם יותר משלמה), אז במה מתבטא הרעיון של "ירידת הדורות" עליו אתה מדבר?
|
|
|
|
|