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
 

 

Sort to Change date MMYYYY to YYYYMM

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort to Change date MMYYYY to YYYYMM
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

Moderator


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

PostPosted: Tue Aug 21, 2012 1:46 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Tue Aug 21, 2012 1:57 pm    Post subject: Reply to: Sort to Change date MMYYYY to YYYYMM
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    Post subject: Reply to: Sort to Change date MMYYYY to YYYYMM
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Tue Aug 21, 2012 7:58 pm    Post subject: Reply to: Sort to Change date MMYYYY to YYYYMM
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: 1703
Location: Australia

PostPosted: Wed Aug 22, 2012 8:41 am    Post subject:
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    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 Fail to change physical VSAM filename... jacobdng CICS 6 Fri Jan 20, 2017 12:36 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


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