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
 

 

Split into mutliple output files

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
krsenthil85

New User


Joined: 31 Aug 2007
Posts: 55
Location: bangalore

PostPosted: Tue Aug 11, 2015 12:22 am    Post subject: Split into mutliple output files
Reply with quote

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
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1756
Location: UK

PostPosted: Tue Aug 11, 2015 12:44 am    Post subject:
Reply with quote

Quote:
either a sort card or Filemgr

so why post in JCL instead of the sort forum or IBM Tools forum?
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 343
Location: USA

PostPosted: Tue Aug 11, 2015 12:53 am    Post subject: Reply to: Split into mutliple output files
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1226
Location: Israel

PostPosted: Tue Aug 11, 2015 12:55 am    Post subject:
Reply with quote

So if there are 10 "blocks" of ISA you will have 10 output files ?
Back to top
View user's profile Send private message
krsenthil85

New User


Joined: 31 Aug 2007
Posts: 55
Location: bangalore

PostPosted: Tue Aug 11, 2015 12:59 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 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 How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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