Sort on date

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
Jairam_baju
Member
Posts: 10
Joined: Thu Jul 30, 2009 8:11 pm
Location: Bangalore

Sort on date

Post by Jairam_baju » Tue Sep 01, 2009 3:33 pm

hi,
i have one file with date. i need to read the date and increment by 1 and write output file. is this possible in sort card

skolusu
Member
Posts: 43
Joined: Sat Jul 26, 2008 12:38 am

Post by skolusu » Tue Sep 01, 2009 8:16 pm

jairam baju,

what kind of date are we talking in here? Is it a current date? If it is current date then it is very easy

If it is any other date , then it would be tricky.

At any rate I need the following details.

1. what is the lrecl and recfm of the input and output files?
2. What is the position and format of the date field
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

Jairam_baju
Member
Posts: 10
Joined: Thu Jul 30, 2009 8:11 pm
Location: Bangalore

Post by Jairam_baju » Wed Sep 02, 2009 8:48 am

yes u r right. if it is the current date then the process is easy. but my case is different, i will get the some date in input file in the yyyyddd format. input file is fb with 80 length. i should add 1 to the date and write a output file with the same length and format.

Alissa Margulies
Member
Posts: 25
Joined: Tue Apr 28, 2009 10:53 pm
Location: USA
Contact:

Post by Alissa Margulies » Tue Sep 29, 2009 2:54 am

SyncSort does not currently have the facility to perform arithmetic on date/time fields. I cannot answer for DFSORT.
Alissa Margulies
SyncSort Mainframe Product Services
zos_tech@syncsort.com
201-930-8260

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Tue Sep 29, 2009 3:20 am

DFSORT does not have built-in functions for arithmetic on date/time fields either.
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

skolusu
Member
Posts: 43
Joined: Sat Jul 26, 2008 12:38 am

Post by skolusu » Sat Oct 30, 2010 1:12 am

Jairam_baju,

With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct, 2010), DFSORT can now add days to a given date quite easily like shown below.

Code: Select all

//STEP0100 EXEC PGM=SORT                          
//SYSOUT   DD SYSOUT=*                            
//SORTIN   DD *                                   
----+----1----+----2----+----3----+----4----+----5
20101029                                          
//SORTOUT  DD SYSOUT=*                            
//SYSIN    DD *                                   
  SORT FIELDS=COPY                                
  INREC OVERLAY=(10:1,8,Y4T,ADDDAYS,+1,TOGREG=Y4T)
//*                                                              



The output from this job is

Code: Select all

20101029 20101030
For complete details on the new DFSORT and ICETOOL functions available with the Oct, 2010 PTF, see:

http://www.ibm.com/support/docview.wss? ... g3T7000242
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

academyindia4

Topic deleted by Admin

Post by academyindia4 » Thu Jan 21, 2016 10:20 am

<< Content deleted By Admin >>

Post Reply

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



Other References
Mainframe Tools and others