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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: is it possible with out using a cobol program...
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 Moderator


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

PostPosted: Wed Mar 22, 2006 9:21 pm    Post subject:
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    Post subject: Frank here is the example....
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    Post subject:
Reply with quote

Use this dfsort trick

http://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 Moderator


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

PostPosted: Thu Mar 23, 2006 10:26 pm    Post subject:
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    Post subject: Thanks...
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    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
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


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