View previous topic :: View next topic
|
Author |
Message |
krsenthil85
New User
Joined: 31 Aug 2007 Posts: 55 Location: bangalore
|
|
|
|
Hi,
I have requirement to split single file into multiple files, the input file is 80 byte EDI file and input file looks like below
Code: |
ISA*00* *00* *16*055169452TST2 *12*8006670959T *150602*091
7*U*00305*000000001*0*P*:~GS*FA*055169452TST2*NIUS271JDWRA*150602*0917*1*X*00305
7*U*00305*000000001*0*P*:~GS*FA*055169452TST2*NIUS271JDWRA*150602*0917*1*X*00305
0~ST*997*000000001~AK1*RA*250~AK9*A*1*1*1~SE*4*000000001~GE*1*1~IEA*1*000000001~
ISA*00* *00* *16*055169452TST2 *12*8006670959T *150602*091
7*U*00305*000000002*0*P*:~GS*FA*055169452TST2*NIUS271JDWRA*150602*0917*2*X*00305
0~ST*997*000000002~AK1*RA*252~AK9*A*1*1*1~SE*4*000000002~GE*1*2~IEA*1*000000002~
ISA*00* *00* *16*055169452TST2 *12*8006670959T *150602*091
7*U*00305*000000003*0*P*:~GS*FA*055169452TST2*NIUS271JDWRA*150602*0917*3*X*00305
0~ST*997*000000003~AK1*RA*251~AK2*820*000001730~AK3*BPR*2~AK4*14*569*2~AK5*R*5~A
K9*R*1*1*0~SE*8*000000003~GE*1*3~IEA*1*000000003~ |
Whenever it encounters a string 'ISA*' at position 1,4 it has to put it into the next file and so on... So the output file should looks like below
File 1
Code: |
ISA*00* *00* *16*055169452TST2 *12*8006670959T *150602*091
7*U*00305*000000001*0*P*:~GS*FA*055169452TST2*NIUS271JDWRA*150602*0917*1*X*00305
7*U*00305*000000001*0*P*:~GS*FA*055169452TST2*NIUS271JDWRA*150602*0917*1*X*00305
0~ST*997*000000001~AK1*RA*250~AK9*A*1*1*1~SE*4*000000001~GE*1*1~IEA*1*000000001~ |
File2
Code: |
ISA*00* *00* *16*055169452TST2 *12*8006670959T *150602*091
7*U*00305*000000002*0*P*:~GS*FA*055169452TST2*NIUS271JDWRA*150602*0917*2*X*00305
0~ST*997*000000002~AK1*RA*252~AK9*A*1*1*1~SE*4*000000002~GE*1*2~IEA*1*000000002~ |
File3
Code: |
ISA*00* *00* *16*055169452TST2 *12*8006670959T *150602*091
7*U*00305*000000003*0*P*:~GS*FA*055169452TST2*NIUS271JDWRA*150602*0917*3*X*00305
0~ST*997*000000003~AK1*RA*251~AK2*820*000001730~AK3*BPR*2~AK4*14*569*2~AK5*R*5~A
K9*R*1*1*0~SE*8*000000003~GE*1*3~IEA*1*000000003~ |
Could you please proivde the either a sort card or Filemgr step to do this through JCL. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Quote: |
either a sort card or Filemgr |
so why post in JCL instead of the sort forum or IBM Tools forum? |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
If you know how many such groups are there in the file then it should not be a problem.
Have you searched the forum first ?
. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
So if there are 10 "blocks" of ISA you will have 10 output files ? |
|
Back to top |
|
|
krsenthil85
New User
Joined: 31 Aug 2007 Posts: 55 Location: bangalore
|
|
|
|
Yes Marso you are correct. As Nic said I posted in wrong forum and I moved it to the DFSORT forum, We can continue our discussion there |
|
Back to top |
|
|
|