View previous topic :: View next topic |
Author |
Message |
oneofspace Beginner
Joined: 18 Nov 2008 Posts: 33 Topics: 14
|
Posted: Fri Apr 17, 2009 4:58 am Post subject: Formatting the record |
|
|
Hi
I am having input file of record length 40, fixed block. It is having records as follows.
Code: | ----+----1----+----2----+----3----+----4
1441AAAAAAAAAAAAAAAACOM1111AAAAAAAAAAAAA
1442BBBBCOM2222BBBBBBBBBBBBBBBBBBBBBBBBB
1443CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1444DDDDDDDDDDDDDDDDDDDDDDCOM3333DDDDDDD
1445EEEEEEEEEEEEEEEEEEEEEEEEECOM5555EEEE
|
The string COMXXXX will appear at any point. It may not present in some records. I need to create output of record length 11 as follows.
Code: | ----+----1-
1441COM1111
1442COM2222
1444COM3333
1445COM5555
|
I want the first 4 numbers and the string COMXXXX. Records not having the string COMXXXX have to be removed.
Is there any way to achieve this using SYNCSORT?
Thanks in advance.
One. |
|
Back to top |
|
|
amargulies Beginner
Joined: 10 Jan 2007 Posts: 123 Topics: 0
|
Posted: Mon Apr 20, 2009 2:16 pm Post subject: |
|
|
Try this SyncSort for z/OS 1.3 application:
Code: | //SORT EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SORTIN DD *
1441AAAAAAAAAAAAAAAACOM1111AAAAAAAAAAAAA
1442BBBBCOM2222BBBBBBBBBBBBBBBBBBBBBBBBB
1443CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1444DDDDDDDDDDDDDDDDDDDDDDCOM3333DDDDDDD
1445EEEEEEEEEEEEEEEEEEEEEEEEECOM5555EEEE
//SYSIN DD *
SORT FIELDS=COPY
INREC PARSE=(%01=(FIXLEN=4),
%02=(STARTAT=C'COM',FIXLEN=7)),
BUILD=(%01,%02)
OUTFIL INCLUDE=(5,3,CH,EQ,C'COM')
/* |
_________________ Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com |
|
Back to top |
|
|
oneofspace Beginner
Joined: 18 Nov 2008 Posts: 33 Topics: 14
|
Posted: Mon Apr 20, 2009 10:45 pm Post subject: |
|
|
Thank you very much Alissa |
|
Back to top |
|
|
|
|