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

Sort to Change date MMYYYY to YYYYMM


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

New User


Joined: 06 Nov 2007
Posts: 84
Location: bangalore

PostPosted: Tue Aug 21, 2012 12:53 pm
Reply with quote

Hi,

I have 2 input files(one file with current date and another file with previous date) with date format 'MMYYYY' at position 19. I want to copy it to an output file with the changed date format of 'YYYYMM' at position 1.

Could anyone let me know the Sort Jcl for this ?

Thanks,
Kumar.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Aug 21, 2012 1:46 pm
Reply with quote

If you just wanted to copy the date at position 19 from input file to output file and reformat it to YYYYMM

An OUTREC statement will do the job for you

After being in forum for sometime you should have figured it out yourself icon_cool.gif
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Aug 21, 2012 1:57 pm
Reply with quote

You can use INREC or OUTREC or OUTFIL with BUILD=(23,2,19,4)
Back to top
View user's profile Send private message
kumar1234

New User


Joined: 06 Nov 2007
Posts: 84
Location: bangalore

PostPosted: Tue Aug 21, 2012 7:39 pm
Reply with quote

Hi,

Now I am able to change the format. But I am getting as shown below,
One above and one below in the output file.

I used sort
SORT FIELDS=COPY
OUTREC FIELDS=(1:21,4,5:19,2)

201206
201207

I want in this format 201206201207, could anyone plase let me know what sort command I need to use to get date next to each other????
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Aug 21, 2012 7:58 pm
Reply with quote

INREC BUILD=(startposofmm1,2,startposofyyy1,4,startposofmm2,2,starposofyyyy2,4)

Will get you output records with the two "dates" next to each other (and nothing else).

If you want to rearrange these in a record, you'll have to give more: sample input file, with locations, sample output file with locations of new data. Recfm and lrecl.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Aug 22, 2012 8:41 am
Reply with quote

Hi,

is this what you are after ?
Code:
//S1       EXEC PGM=ICETOOL                       
//TOOLMSG  DD SYSOUT=*                           
//DFSMSG   DD SYSOUT=*                           
//IN       DD *  file1                                 
                  062012   
//         DD *  file2                     
                  072012                         
//OUT      DD SYSOUT=*                           
//TOOLIN   DD *                                   
RESIZE FROM(IN) TO(OUT) TOLEN(12) USING(CTL1)     
//CTL1CNTL DD *                                   
  INREC BUILD=(21,4,19,2)                         
/*



Gerry
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 How to split large record length file... DFSORT/ICETOOL 8
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top