Add to Favorites    Make Home Page 2454 Online  
 Language Categories  
 Our Services  

Home » COBOL Home » General Programs Home » Date Difference in Mainframe COBOL

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Date Difference in Mainframe COBOL
Author Muruganandham
Author Email binarybreeze82 [at] yahoo.co.in
Description This program finds the difference between two dates given from the JCL.
Category COBOL » General Programs
Hits 391003
Code Select and Copy the Code
IDENTIFICATION DIVISION. 00010000 PROGRAM-ID. CDATEC. 00020000 00021000 DATA DIVISION. 00030000 00031000 WORKING-STORAGE SECTION. 00040000 00041000 01 YR PIC 9999. 00050000 00051000 01 YR1 PIC 9999. 00060000 00060100 01 YR2 PIC 9999. 00061000 00062000 01 MON PIC 99. 00070000 00071000 01 MON1 PIC 99. 00080000 00080100 01 MON2 PIC 99. 00081000 00082000 01 D1 PIC 99. 00090000 00091000 01 D2 PIC 99. 00100000 00101000 01 QU1 PIC 99. 00110000 00111000 01 REM1 PIC 99. 00120000 00121000 01 REM2 PIC 99. 00130000 00131000 01 REM3 PIC 99. 00140000 00141001 01 T PIC 99999999. 00150000 00150101 01 T1 PIC 99999999. 00151000 00151101 01 T2 PIC 99999999. 00152000 00153001 PROCEDURE DIVISION. 00160000 00161001 MAINP. 00170000 ACCEPT YR1. 00180000 ACCEPT YR2. 00190000 ACCEPT MON1. 00200000 ACCEPT MON2. 00210000 ACCEPT D1. 00220000 ACCEPT D2. 00230000 00240001 PERFORM LP-PARA VARYING YR FROM 1900 BY 1 UNTIL YR = YR1. 00270000 PERFORM MN-PARA VARYING MON FROM 1 BY 1 UNTIL MON = MON1. 00280000 00281001 MOVE T TO T1. 00290000 COMPUTE T1 = T1 + D1. 00290100 MOVE 0 TO T. 00291000 00292001 PERFORM LP-PARA VARYING YR FROM 1900 BY 1 UNTIL YR = YR2. 00330000 PERFORM MN-PARA VARYING MON FROM 1 BY 1 UNTIL MON = MON2. 00340000 00341001 MOVE T TO T2. 00350000 COMPUTE T2 = T2 + D2. 00350100 COMPUTE T = T2 - T1. 00351000 00352001 DISPLAY "THE DIFFERENCE BETWEEN DATES: ". 00360000 DISPLAY D1 "/" MON1 "/" YR1 " & " D2 "/" MON2 "/" YR2 " IS ".00361000 DISPLAY T. 00362000 STOP RUN. 00370000 00371001 LP-PARA. 00380000 DIVIDE YR BY 400 GIVING QU1 REMAINDER REM1. 00381000 DIVIDE YR BY 100 GIVING QU1 REMAINDER REM2. 00382000 DIVIDE YR BY 4 GIVING QU1 REMAINDER REM3. 00383000 IF REM1 = 0 OR ( REM2 IS NOT = 0 AND REM3 = 0 ) THEN 00390000 COMPUTE T = T + 366 00400000 ELSE 00410000 COMPUTE T = T + 365 00420000 END-IF. 00430000 00431001 MN-PARA. 00440000 DIVIDE YR BY 400 GIVING QU1 REMAINDER REM1. 00441000 DIVIDE YR BY 100 GIVING QU1 REMAINDER REM2. 00442000 DIVIDE YR BY 4 GIVING QU1 REMAINDER REM3. 00443000 IF MON = 1 OR MON = 3 OR MON = 5 OR MON = 7 OR MON = 8 00450000 OR MON = 10 OR MON = 12 THEN 00460000 COMPUTE T = T + 31 00470000 ELSE IF MON = 4 OR MON = 6 OR MON = 9 OR MON = 11 THEN 00480000 COMPUTE T = T + 30 00490000 ELSE IF REM1 = 0 OR ( REM2 IS NOT = 0 AND REM3 = 0 ) THEN 00500000 COMPUTE T = T + 29 00510000 ELSE 00520000 COMPUTE T = T + 28 00530000 END-IF. 00540000

Related Source Codes

Script Name Author
sandeep kumar singh
COBOL ON-SCREEN CALCULATOR (Mini Project) Stephen Rendell
Learn Cobol in a Day C.KUMARESAN
my atm (Mini Project) sandeep kumar singh
Merge Two Files. Rakshith
Naveen Chandran P.K
Program of USSR naval stock list Jai Ganesh
PRIME NUMBER Grace Hill
Sequential File - Health Care C.KUMARESAN
Task for the day program. Rama Murthy M
FIBONACCI series Abir Pathak
PRIME NUMBER Grace Hill
Harmonic Series Abir Pathak
Cobol sequential file program. b.s.prakash
Introduction to COBOL. B.S.prakash

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptId=603


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review