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: 1534
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: 7308

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: 7308

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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm


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