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

is it possible with out using a cobol program...


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

New User


Joined: 22 Mar 2006
Posts: 3

PostPosted: Wed Mar 22, 2006 6:41 pm
Reply with quote

hi,
i need to compare two flat files A and B. B has all the recs of A in addition it has few more records.. i was to exclude all the different records in B and to write it another falt files. i know this is stupid one but one case arised for me in testing..
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Mar 22, 2006 9:21 pm
Reply with quote

It's not really clear what you want to do. Please show an example of the records in input file A and input file B and what you want for output. Also, what is the RECFM and LRECL of input file A and input file B?
Back to top
View user's profile Send private message
pm_prasanth

New User


Joined: 22 Mar 2006
Posts: 3

PostPosted: Thu Mar 23, 2006 11:24 am
Reply with quote

PS1 has 4 records.

1aaa
0bbb
3ccc
5ddd

and PS2 has 6 records

1aaa
7bbb
8ddd
3ggg
4ccc
6eee

I want to fetch all the records in PS2 which matches characters in the column (3 to 5) of PS1 and write it in PS3. Its possible in cobol . Is it possible in JCL or SORTs like icetool ,dfs sort.


The oupout file PS3 must have the following reocrds.

1aaa
7bbb
4ccc
8ddd
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Thu Mar 23, 2006 3:37 pm
Reply with quote

Use this dfsort trick

www-03.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst02.html#t05


regards
jai
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Mar 23, 2006 10:26 pm
Reply with quote

Actually, you don't need the SPLICE trick for this one. You can do it more simply with SELECT. Here's a DFSORT/ICETOOL job that will do what you want. You said your key is in columns 3-5 but your example shows it in 2-4 so I used that. You can change 2,3,CH to 3,3,CH if appropriate.

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD DSN=...  input file1
//    DD DSN=...  input file2
//OUT DD DSN=...  output file
//TOOLIN DD *
SELECT FROM(CON) TO(OUT) ON(2,3,CH) LASTDUP
/*


You can also switch the order of the CON files and use FIRSTDUP, which might be more efficient if you have a large number of records:

Code:

//S2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD DSN=...  input file2
//    DD DSN=...  input file1
//OUT DD DSN=...  output file
//TOOLIN DD *
SELECT FROM(CON) TO(OUT) ON(2,3,CH) FIRSTDUP
/*
Back to top
View user's profile Send private message
pm_prasanth

New User


Joined: 22 Mar 2006
Posts: 3

PostPosted: Sat Mar 25, 2006 1:35 pm
Reply with quote

Frank n Rajan.. Thanks a lot..
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top