Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 92
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: 92
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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
No new posts Checking Current date vickey_dw DFSORT/ICETOOL 1 Wed Feb 08, 2017 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us