Porno

Www Zenrasexy Singles Zenra Sexy Women Zenra Sexy En 1 Zenra Sexy MAINFRAME FORUM: Date converstion using DFSORT (DD-MMM-YY to MM/DD/YYYY)

Www Zenrasexy Singles Zenra Sexy Women Zenra Sexy En 1 Zenra Sexy

Zenra nsearchssearch;
| Sexy ns Zenra ; Sexy B Women Women asearchusearchlsearch& Sexy b Singles p Sexy | Singles n Sexy ssearch;D Singles w Women l Zenra as Zenra n Zenra s Sexy ;| Products | Refer | Info | Programs | JCLs | Forum Rules |
 
 
 
Date converstion using DFSORT (DD-MMM-YY to MM/DD/YYYY)

 
       IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
saravanakumar N

New User


Joined: 24 Mar 2010
Posts: 5
Location: Chennai

Posted: Thu Dec 22, 2011 7:19 pm    Post subject: Date converstion using DFSORT (DD-MMM-YY to MM/DD/YYYY)

Hi

I need to convert input record's date format from DD-MMM-YY (29-OCT-08) to MM/DD/YYYY (10/29/2008). Can we do this using DFSORT or ICETOOL..?

my sample record is
1N4AA51E09C800016~29-OCT-08~TN
Back to top

Binop B

Active User


Joined: 18 Jun 2009
Posts: 348
Location: India

Posted: Thu Dec 22, 2011 8:09 pm    Post subject:

Hi Saravana,

Yes, this can be done using DFSORT.

Tips : Looks into the usage of INREC - IFTHEN-WHEN - OUTREC.

Also, there are same or related topics aleady discussed in this forum.

*Note: Preferrably, when asking similiar kind of question, it is better to post the expected output record also.
And use 'code' button to display the record in a more readable form.
Back to top
Bill Woodger

Senior Member


Joined: 09 Mar 2011
Posts: 2858
Location: Portugal

Posted: Thu Dec 22, 2011 9:15 pm    Post subject: Reply to: Date converstion using DFSORT (DD-MMM-YY to MM/DD

Code:
//DATECONV EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SYMNAMES DD *
ALL-OF-RECORD,1,30,CH
FIRST-PART-OF-RECORD,1,18,CH
MMM-IN-RECORD,22,3,CH
DD-IN-RECORD,19,2,CH
YY-IN-RECORD,26,2,CH
LAST-PART-OF-RECORD,28,3,CH
REFORMATTED-DATE,31,6,CH
//SORTIN   DD *
1N4AA51E09C800016~29-OCT-08~TN
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,
     BUILD=(ALL-OF-RECORD,31:
       MMM-IN-RECORD,
       CHANGE=(2,C'JAN',C'01',C'FEB',C'02',C'MAR',C'03',C'APR',C'04',
                 C'MAY',C'05',C'JUN',C'06',C'JUL',C'07',C'AUG',C'08',
                 C'SEP',C'09',C'OCT',C'10',C'NOV',C'11',C'DEC',C'12'),
       DD-IN-RECORD,
       YY-IN-RECORD)),
        IFTHEN=(WHEN=INIT,
     BUILD=(FIRST-PART-OF-RECORD,
         REFORMATTED-DATE,Y2W,EDIT=(TT/TT/TTTT),
         LAST-PART-OF-RECORD))


Gives this output:

Code:
1N4AA51E09C800016~10/29/2008~TN


I "borrowed" the idea from the DFSORT Smart Tricks manual for how to do the names to numbers.

I suspect a cleaner solution will arrive.
Back to top
Skolusu

DFSORT Developer


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

Posted: Thu Dec 22, 2011 9:20 pm    Post subject:

Use the following DFSORT JCL which will give you the desired results. I assumed that the reformatted date is placed at pos 40 and your input lrecl=80 and recfm=fb
Code:

//STEP0100 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                       
----+----1----+----2----+----3----+----4----+----5----+----6----+----7-
1N4AA51E09C800016~29-OCT-08~TN                                         
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  OPTION COPY,Y2PAST=1980                                             
  INREC IFOUTLEN=80,IFTHEN=(WHEN=INIT,OVERLAY=(81:22,3,19,2,26,2)),   
  IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=81,                             
   INOUT=(C'JAN',C'01',C'FEB',C'02',C'MAR',C'03',C'APR',C'04',         
          C'MAY',C'05',C'JUN',C'06',C'JUL',C'07',C'AUG',C'08',         
          C'SEP',C'09',C'OCT',C'10',C'NOV',C'11',C'DEC',C'12'))),     
  IFTHEN=(WHEN=INIT,OVERLAY=(40:81,6,Y2W(/)))                         
//*                                                                   
Back to top
Display posts from previous:   
       IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 


©2003-2012 MAINFRAMESINDIA Software Design Corp. All Rights reserved.
 
Master the Mainframes | Bookmarks | Subscriptions | Site Map | Polls | Photos | FAQ | Rules | Contact Us
 
mWww Zenrasexy Singles Zenra Sexy Women Zenra Sexy En 1 Zenra Sexy MAINFRAME FORUM: Date converstion using DFSORT (DD-MMM-YY to MM/DD/YYYY)c f Dating Zenra Sexy zWww Zenrasexy Singles Zenra Sexy Women Zenra Sexy En 1 Zenra Sexy MAINFRAME FORUM: Date converstion using DFSORT (DD-MMM-YY to MM/DD/YYYY)k Zenra Sexy