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 a VB file into two

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Arun Bharath

New User


Joined: 18 Feb 2011
Posts: 3
Location: Bangalore

PostPosted: Fri Feb 18, 2011 5:05 pm    Post subject: Split a VB file into two
Reply with quote

Hi All,

Need your help,

I have an i/p VB file with rec length 124 and it is

0 HEADER
1 AAAAAAA
2 AAAAAAA 52 100
1 BBBBBBB
2 BBBBBBB 16 320
1 CCCCCCC
2 CCCCCCC 52 120
1 DDDDDDD
2 DDDDDDD 16 220
9 TRAILER 760

I need two o/p files based on '52' or '16' in 90th position and to add values in 100th position for trailer record

FILE A

0 HEADER
1 AAAAAAA
2 AAAAAAA 52 100
1 CCCCCCC
2 CCCCCCC 52 120
9 TRAILER 220

FILE B

0 HEADER
1 BBBBBBB
2 BBBBBBB 16 320
1 DDDDDDD
2 DDDDDDD 16 220
9 TRAILER 540
Back to top
View user's profile Send private message

Skolusu

Senior Member


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

PostPosted: Fri Feb 18, 2011 11:04 pm    Post subject:
Reply with quote

Arun Bharath,

Can the Trailer record be generated dynamically with text and summation?

What is the format of the field to be summed? Does all the records which have '2' in position 5 (since input is VB , your input actually starts from pos 5) have the field to be summed?

Did you consider the RDW when calculating the positions of records to be summed?

Are these groups of records? Each group starts with '1' in pos 5 and ends with a record of '2' ?
Back to top
View user's profile Send private message
Arun Bharath

New User


Joined: 18 Feb 2011
Posts: 3
Location: Bangalore

PostPosted: Sun Feb 20, 2011 10:15 pm    Post subject:
Reply with quote

Skolusu

Yes, I have considered the RDW and these are group of records start with '1' and end with '2'.

yes all the records start with '2' have the fields to be summed and the format of the field is S9(10)V99..

Yes the Trailer record can be generated dynamically with text and summation..
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Feb 22, 2011 2:52 am    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for. Note that the IN1 DD and IN2 DD must both point to your input data set.

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=...  input file (VB/124)
//IN2 DD DSN=...  input file (VB/124)
//OUT1 DD DSN=...  output file1 (VB/124)
//OUT2 DD DSN=...  output file2 (VB/124)
//SYSIN DD *
  JOINKEYS F1=IN1,FIELDS=(7,7,A),SORTED
  JOINKEYS F2=IN2,FIELDS=(5,7,A),SORTED
  OPTION COPY
  REFORMAT FIELDS=(F1:1,4,F2:13,2,F1:5)
  OUTFIL FNAMES=OUT1,REMOVECC,INCLUDE=(5,2,CH,EQ,C'52'),
    BUILD=(1,4,7),
   HEADER1=('0 HEADER'),
   TRAILER1=('9 TRAILER ',TOT=(102,12,ZD,TO=ZD,LENGTH=12))
  OUTFIL FNAMES=OUT2,REMOVECC,INCLUDE=(5,2,CH,EQ,C'16'),
    BUILD=(1,4,7),
   HEADER1=('0 HEADER'),
   TRAILER1=('9 TRAILER ',TOT=(102,12,ZD,TO=ZD,LENGTH=12))
/*
//JNF1CNTL DD *
  OMIT COND=(5,1,SS,EQ,C'09')
/*
//JNF2CNTL DD *
  INCLUDE COND=(5,1,CH,EQ,C'2')
  INREC BUILD=(1,4,5:7,7,13:90,2)
/*
Back to top
View user's profile Send private message
Arun Bharath

New User


Joined: 18 Feb 2011
Posts: 3
Location: Bangalore

PostPosted: Tue Feb 22, 2011 8:07 pm    Post subject:
Reply with quote

Thanks a lot icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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