Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
split 2 input files into 3 output files based on fields

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

New User


Joined: 07 May 2005
Posts: 9
Location: Duluth, US

PostPosted: Mon May 25, 2009 3:58 pm    Post subject: split 2 input files into 3 output files based on fields
Reply with quote

i want to convert 2 input files into 3 output files based on below conditions

i/p record first 2 byte - pic 9(2)
last 5 bytes - pic s9(9) comp-3

input file 1

15abc12345
15ggd11111
15hsr22222
15asd98765

input file 2

16xyz12345
16trh44444
16utt55555
16gdf98765

.....

output 1
15abc12345
15ggd11111
15hsr22222
15asd98765
16trh44444
16utt55555


output2
16xyz12345
16gdf98765

output 3
1612345 name1 field1
1698765 name2 field2

names1 & 2 are x(25)
fields1 & 2 are s9(9) comp-3

i want to do this in a single step
Back to top
View user's profile Send private message

bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Mon May 25, 2009 4:52 pm    Post subject:
Reply with quote

Can you explain the your conditions clearly.I am not clear with that....
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Mon May 25, 2009 4:54 pm    Post subject:
Reply with quote

Quote:

i want to convert 2 input files into 3 output files based on below conditions.


What are those conditions?

Quote:

names1 & 2 are x(25)
fields1 & 2 are s9(9) comp-3


From where these fields you are extracting?

Provide Information properly to get proper solutions.
Back to top
View user's profile Send private message
prathap_ts
Warnings : 1

New User


Joined: 07 May 2005
Posts: 9
Location: Duluth, US

PostPosted: Mon May 25, 2009 5:24 pm    Post subject:
Reply with quote

conditions

output 1 should contain unique records from input 1 and 2 based on last 5 digits

15abc12345
15ggd11111
15hsr22222
15asd98765
16trh44444
16utt55555


output 2 should contain duplicate records from input 1 and 2 based on last 5 digits (only 2nd occurance)

16xyz12345
16gdf98765

output 3 is made of first two bytes , last five bytes of duplicates records (say output 2) plus few more new fields like name1 and field1

1612345 name1 field1
1698765 name2 field2

leave the new fields... below output is ok in file 3

1612345
1698765

thanks in advance.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue May 26, 2009 7:56 pm    Post subject: Reply to: split 2 input files into 3 output files based on f
Reply with quote

Pratap_ts,

The following DFSORT JCL will give you the desired results. I assumed that your both files are of the same lrecl and recfm.

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=your input file1,DISP=SHR
//         DD DSN=Your input file2,DISP=SHR                   
//OUT1     DD SYSOUT=*                                         
//OUT2     DD SYSOUT=*                                         
//OUT3     DD SYSOUT=*                                         
//SYSIN    DD *                                               
  SORT FIELDS=(6,5,PD,A),EQUALS                               
  OUTREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(6,5))               
  OUTFIL FNAMES=OUT1,INCLUDE=(81,8,ZD,EQ,1),BUILD=(1,10)       
  OUTFIL FNAMES=OUT2,INCLUDE=(81,8,ZD,GT,1),BUILD=(1,10)       
  OUTFIL FNAMES=OUT3,INCLUDE=(81,8,ZD,GT,1),BUILD=(1,2,6,5)   
/*
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 SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us