View previous topic :: View next topic
|
Author |
Message |
kumar1234
New User
Joined: 06 Nov 2007 Posts: 84 Location: bangalore
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
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 |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You can use INREC or OUTREC or OUTFIL with BUILD=(23,2,19,4) |
|
Back to top |
|
|
kumar1234
New User
Joined: 06 Nov 2007 Posts: 84 Location: bangalore
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
|