Hi,
Can any one throw some light on 9's complement date transformations, so as to what it is and why it is necessary and also can some one give me links to material which explains what level 88 and all those levels in the cobol copy book mean.
I am using Data Stage MVS.
Thanks
Srikie
9's complement date transformations
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Srikie,
In cobol, 88 levels are for validation purpose.
In other words, if you have something like,
01 FULL-RECORD.
05 MY-NUMBER PIC X.
88 VALID-CAP-CHAR 'A' THRU 'Z'.
88 VALID-LOW-CHAR 'a' THRU 'z'.
88 VALID-NUM-CHAR '0' THRU '9'.
Then in your Procedure division, you can check whether the MY-NUMBER has a valid char. by checking either as
IF (MY-NUMBER >= 'A' AND MY-NUMBER <= 'Z') OR
(MY-NUMBER >= 'a' AND MY-NUMBER <= 'z') OR
(MY-NUMBER >= '0' AND MY-NUMBER <= '9')
[Then]
PERFORM MY-PARA.
Alternatively, you can check as
IF VALID-CAP-CHAR OR VALID-LOW-CHAR OR VALID-NUM-CHAR
[Then]
PERFORM MY-PARA.
Answer to second question,
A COBOL copy book is like a library to dll. It is a bit of code that you can include (like an #include in c/c++) to bring the code in that page into your program. It is generally used for your DATA DIVISION file section or PROCEDURE DIVISION logic that must be common.
In cobol, 88 levels are for validation purpose.
In other words, if you have something like,
01 FULL-RECORD.
05 MY-NUMBER PIC X.
88 VALID-CAP-CHAR 'A' THRU 'Z'.
88 VALID-LOW-CHAR 'a' THRU 'z'.
88 VALID-NUM-CHAR '0' THRU '9'.
Then in your Procedure division, you can check whether the MY-NUMBER has a valid char. by checking either as
IF (MY-NUMBER >= 'A' AND MY-NUMBER <= 'Z') OR
(MY-NUMBER >= 'a' AND MY-NUMBER <= 'z') OR
(MY-NUMBER >= '0' AND MY-NUMBER <= '9')
[Then]
PERFORM MY-PARA.
Alternatively, you can check as
IF VALID-CAP-CHAR OR VALID-LOW-CHAR OR VALID-NUM-CHAR
[Then]
PERFORM MY-PARA.
Answer to second question,
A COBOL copy book is like a library to dll. It is a bit of code that you can include (like an #include in c/c++) to bring the code in that page into your program. It is generally used for your DATA DIVISION file section or PROCEDURE DIVISION logic that must be common.
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Well thanks for very informative response but can you also tell me why do they use the 9's complement version for the date in mainframes and also what does '8764' mean i mean does that mean 87 year and 64 something in this example. Sorry to bother you with such basic questions but I am a rookie so.........