Hi All,
I have below requirement
I have a flat file it contains YYYY-MM-DD in the header record (1st record of the file and starts at col. 2). I have to compare this date filed with current date and set the RC=8 if they are not equal.
can it be done using SORT card ?
Comparing Date with current date
Moderators: Frank Yaeger, Moderator Group
-
- Member
- Posts: 25
- Joined: Sun Feb 05, 2012 10:59 pm
- Location: Bangalore
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
You can use a DFSORT/ICETOOL job like the following to do what you asked for:
Code: Select all
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//SYMNAMES DD *
CURDATE,S'&YR4.-&MON.-&DAY'
//SYMNOUT DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
H2012-02-13
D RECORD 01
D RECORD 02
D RECORD 03
//TOOLIN DD *
COUNT FROM(IN) RC8 NOTEMPTY USING(CTL1)
//CTL1CNTL DD *
OPTION STOPAFT=1
INCLUDE COND=(2,10,CH,EQ,CURDATE)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
-
- Member
- Posts: 25
- Joined: Sun Feb 05, 2012 10:59 pm
- Location: Bangalore
Thanks Frank!
below piece of code also worked for me
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
H2012-02-13
D RECORD 01
D RECORD 02
D RECORD 03
//TOOLIN DD *
COUNT FROM(IN) RC4 EMPTY USING(CTL1)
//CTL1CNTL DD *
OPTION STOPAFT=1
INCLUDE COND=(2,10,CH,EQ,DATE1(-))
/*
this gives RC=4 if the date is not matching with current date and gives RC=0 if matches.
could you clarify if we could set RC=8 using COUNT?
i think we can set RC 0,4,12 but not 8.
below piece of code also worked for me
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
H2012-02-13
D RECORD 01
D RECORD 02
D RECORD 03
//TOOLIN DD *
COUNT FROM(IN) RC4 EMPTY USING(CTL1)
//CTL1CNTL DD *
OPTION STOPAFT=1
INCLUDE COND=(2,10,CH,EQ,DATE1(-))
/*
this gives RC=4 if the date is not matching with current date and gives RC=0 if matches.
could you clarify if we could set RC=8 using COUNT?
i think we can set RC 0,4,12 but not 8.
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
RC8 was added to DFSORT's ICETOOL in Nov, 2010.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page