IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Splitting VB File with Goups


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sauthur

New User


Joined: 26 Nov 2013
Posts: 4
Location: USA

PostPosted: Sat Apr 05, 2014 2:46 am
Reply with quote

Hi,
I have a VB file with Multiple header+detail records+trailer groups. Group should not be changed or sorted.
The file will contain say 51000 groups it need to be split this into two files one with 25000 groups and balance 26000 groups to second file. Two output file need to be in VB format

Please suggest me a sort
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Sat Apr 05, 2014 3:52 am
Reply with quote

You might wants to see, and look for "Sort detail records between headers and trailers"

I believe you would want to sort the details between the headers trailers.

ftp.software.ibm.com/storage/dfsort/mvs/sorttrck.pdf

And provide sample input data and what is the output expected whith what logic.

Thanks,
Rohit
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Sat Apr 05, 2014 3:55 am
Reply with quote

Answer all the questions.

1. How do you identify the Header? Is there an indicator? If so what is the position and format of the indicator?
2. How do you identify the detail record? Is there an indicator? If so what is the position and format of the indicator?
3. How do you identify the trailer record? Is there an indicator? If so what is the position and format of the indicator?
4. Is the number of groups constant? or do you need to dynamically find out as to how many group exist and then divide the input file into 2 files? or do you want the split to happen for every 25,000 groups?

5. Last but not least run the following Job and show us the complete sysout, so that we can determine the level of DFSORT you have at your shop.

Code:

//STEP0100 EXEC PGM=SORT         
//SYSOUT   DD SYSOUT=*           
//SORTIN   DD *                 
//SORTOUT  DD SYSOUT=*           
//SYSIN    DD *                 
  OPTION COPY                   
//*
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Sat Apr 05, 2014 4:03 am
Reply with quote

Rohit Umarjikar wrote:
I believe you would want to sort the details between the headers.

ftp.software.ibm.com/storage/dfsort/mvs/sorttrck.pdf

Thanks,
Rohit



Rohit,

Please understand the question before you suggest a solution. OP clearly mentioned he does NOT want to SORT the groups. Why would you suggest a sorting Groups Solution?

sauthor wrote:
Group should not be changed or sorted.


It would make sense if had you suggested "Include or omit groups of records" trick instead of "Sort detail records between headers and trailers"

I appreciate your help, if you are suggesting something way off it is double the work for me.
Back to top
View user's profile Send private message
sauthur

New User


Joined: 26 Nov 2013
Posts: 4
Location: USA

PostPosted: Sat Apr 05, 2014 6:29 am
Reply with quote

Its an EDI message. HD is the identifier for header TRL is the trailer. But no identifier for detail records. No detail record start with HD or TRL. All start at 1.
Back to top
View user's profile Send private message
sauthur

New User


Joined: 26 Nov 2013
Posts: 4
Location: USA

PostPosted: Sat Apr 05, 2014 6:49 am
Reply with quote

1. How do you identify the Header? Is there an indicator? If so what is the position and format of the indicator?
Ans: Header Starts with 'HD' start at 1
2. How do you identify the detail record? Is there an indicator? If so what is the position and format of the indicator?
Ans: No Identifier But start at position 1 (Not HD or TRL)
3. How do you identify the trailer record? Is there an indicator? If so what is the position and format of the indicator?
Ans: Trailer Start with TRL at position 1
4. Is the number of groups constant? or do you need to dynamically find out as to how many group exist and then divide the input file into 2 files? or do you want the split to happen for every 25,000 groups?
Ans: Only First file is used for Processing which can have max 25000 Message groups. All the message groups beyond 25000 should go to second file which is kind of back up.
If say input file has only 20000 message groups then all should go to first file
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Apr 07, 2014 10:20 pm
Reply with quote

Code:

//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DISP=SHR,DSN=Your Input VB File
//OUT1     DD SYSOUT=*                                               
//OUT2     DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  OPTION COPY                                                         
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,8X,5)),                         
  IFTHEN=(WHEN=GROUP,BEGIN=(13,2,CH,EQ,C'HD'),END=(13,3,CH,EQ,C'TRL'),
  PUSH=(5:ID=8))                                                     
                                                                     
  OUTFIL FNAMES=OUT1,INCLUDE=(5,8,ZD,LE,25000),BUILD=(1,4,13)         
  OUTFIL FNAMES=OUT2,SAVE,BUILD=(1,4,13)                             
//*
Back to top
View user's profile Send private message
sauthur

New User


Joined: 26 Nov 2013
Posts: 4
Location: USA

PostPosted: Mon Apr 07, 2014 11:20 pm
Reply with quote

Thanks a lot, It worked as perfect
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top