IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to reformat the date using dfsort????


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Thu Jun 28, 2012 6:10 pm
Reply with quote

Hi All,

In one of my requirements I have to generate a report through DFSORT.
I need the below 2 dates in the header of report in the mentioned formats:

Date 1 --> DD MMM YY --> eg: 31 MAY 12
Date 2 --> DD MMM YY HH.MM.SS --> eg: 02 JUN 12 02.56.33

Date 1 is the processing date which is obtained from an input file format DD/MM/YY. This date has to be converted into the DD MMM YY format in the report.

Date 2 is the current system time stamp which has to be populated in the report in the format DD MMM YY HH.MM.SS

Could any one please help in getting the above needed date formats through DFSORT.

Thanks in advance.
Ram.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jun 28, 2012 10:01 pm
Reply with quote

ram_vizag,

use the following DFSORT JCL which will give you the desired results
Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                                 
----+----1----+----2----+----3----+----4----+----5----+----6----
PROCESS DATE :31/05/12.                                         
RECORD - 1                                                     
RECORD - 2                                                     
RECORD - 3                                                     
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
  INREC IFOUTLEN=80,                                           
  IFTHEN=(WHEN=INIT,OVERLAY=(81:DATE1,X,85,2,X,18,2,2X)),       
  IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=90,                       
  INOUT=(C'01',C'JAN',C'02',C'FEB',C'03',C'MAR',C'04',C'APR',   
         C'05',C'MAY',C'06',C'JUN',C'07',C'JUL',C'08',C'AUG',   
         C'09',C'SEP',C'10',C'OCT',C'11',C'NOV',C'12',C'DEC'))),
  IFTHEN=(WHEN=(1,12,CH,EQ,C'PROCESS DATE'),                   
  BUILD=(1,16,X,94,3,X,21,2,X,                                 
         C'RUN DATE : ',87,2,X,90,3,X,83,2,X,TIME))             
//*


The output from this is
Code:

PROCESS DATE :31 MAY 12 RUN DATE : 28 JUN 12 09:31:04   
RECORD - 1                                               
RECORD - 2                                               
RECORD - 3                                               
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Fri Jun 29, 2012 11:18 am
Reply with quote

Thanks Skolusu..icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top