Extracting date through sort to get MMCCYY format

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

Moderators: Frank Yaeger, Moderator Group

Post Reply
Sumedh
Member
Posts: 1
Joined: Wed Aug 16, 2017 1:14 am

Extracting date through sort to get MMCCYY format

Post by Sumedh » Wed Aug 16, 2017 1:21 am

Hi ,

I have a requirement wherein I need to create a file having Current month and current year in MMCCYY format (082017)

I am using various DATE functions but none of them are providing date in MMCCYY format.

Can anyone help me to get a current month and year in a single step through sort or ICETOOL

My output file should have onyl current month and year ( MMCCYY_

Code: Select all

 //STEP02   EXEC PGM=SYNCSORT       
//*                                
//SORTIN   DD *                    
//*                                
//SORTOUT  DD SYSOUT=*             
//*                                
//SYSPRINT DD SYSOUT=*             
//SYSUDUMP DD SYSOUT=*             
//SYSOUT   DD SYSOUT=*             
//SYSIN    DD *                    
   OPTION COPY                     
   OUTFIL REMOVECC,                
   HEADER1=(1:DATENS(4MD))         
//*    
Output :20170815

Required output 082017

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