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

Active User


Joined: 21 Aug 2008
Posts: 107
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

Active User


Joined: 21 Aug 2008
Posts: 107
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 Reformat clause in joinkeys sortcard ... Mounika Nemani DFSORT/ICETOOL 2 Thu May 31, 2018 5:35 pm
No new posts How to Count a particular record in a... Mounika Nemani DFSORT/ICETOOL 5 Tue May 29, 2018 1:07 pm
No new posts Need urgent suggestion on DFSORT subratarec DFSORT/ICETOOL 6 Wed Mar 21, 2018 8:46 pm
No new posts Formatting using DFsort Guru Nandu DFSORT/ICETOOL 5 Thu Nov 30, 2017 7:33 am
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am

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