View previous topic :: View next topic
|
Author |
Message |
Magna
New User
Joined: 30 Oct 2006 Posts: 24
|
|
|
|
Hi,
I have a requirement. I have a file which is of LRECL 100 bytes and the record layout is like given below.
11AAAAXXXXXX
2BBBBXXXXXX
3CCCCXXXXXX
11aaaaxxxxxx
2bbbbxxxxxx
3ccccxxxxxx
Note: there are no sequence numbers present and the 1 2 3 given before A B C denotes the record types. So which means we have to combine all the record types into one record and the output file length should be 300 bytes.
and the o/p file should have the values as below.
11AAAAXXXXXX 2BBBBXXXXXX 3CCCCXXXXXX
11aaaaxxxxxx 2bbbbxxxxxx 3ccccxxxxxx
I have to use Syncsort to achieve this. Can someone please give an idea how this can be done. This can be achieved using SPLICE but still the examples which I got from the searches are not relevant for this.
Thanks,
Magna. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Which Syncsort version do you have? |
|
Back to top |
|
|
Magna
New User
Joined: 30 Oct 2006 Posts: 24
|
|
|
|
Its Synctool Release 1.6.2 |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
Which Syncsort version do you have? |
Quote: |
there are no sequence numbers present |
You said there are no sequence numbers, but will there be record types - 1,2 or 3 present at pos-1 for all the records? |
|
Back to top |
|
|
Magna
New User
Joined: 30 Oct 2006 Posts: 24
|
|
|
|
The record types will be present in position 2 and in position 1 of every record type 1 the value 1 will be present. |
|
Back to top |
|
|
Magna
New User
Joined: 30 Oct 2006 Posts: 24
|
|
|
|
Aplogies... the version is 1.3.2.0R |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
The below Syncsort job should work for your requirement.
Code: |
//STEP01 EXEC PGM=SORT
//SORTIN DD DSN= Input file (FB/100)
//SYSOUT DD SYSOUT=*
//SORTOUT DD DSN= Output file (FB/300)
//SYSIN DD *
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,ZD,EQ,1),PUSH=(101:ID=1,1,100)),
IFTHEN=(WHEN=GROUP,BEGIN=(2,1,ZD,EQ,2),PUSH=(202:1,100),RECORDS=2),
IFTHEN=(WHEN=(2,1,ZD,EQ,3),OVERLAY=(302:1,100))
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,SECTIONS=(101,1,TRAILER3=(102,300)),BUILD=(300X) |
|
|
Back to top |
|
|
|