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: 1715
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: 331
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: 1219
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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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