Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
how to reformat the date using dfsort????

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 94
Location: hyd

PostPosted: Thu Jun 28, 2012 6:10 pm    Post subject: how to reformat the date using dfsort????
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    Post subject:
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

New User


Joined: 21 Aug 2008
Posts: 94
Location: hyd

PostPosted: Fri Jun 29, 2012 11:18 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us