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
 

 

Sort two files and copy them in a single step

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

New User


Joined: 13 Feb 2007
Posts: 55
Location: Pune India

PostPosted: Wed Aug 22, 2007 4:42 pm    Post subject: Sort two files and copy them in a single step
Reply with quote

hi
i need to sort two files and copy them in a single step.also, i need to give some include condition for sorting

the intention is somewhat like this
//EXEC PGM SORT
//SORTIN DD DSN=DSNAME1
DD DSN=DSNAME2
//SORTOUT DD DSN=DSNAME3
SYSIN DD DSN=CARDLIBRARY NAME

In the card library, can i give steps for both sorting and including??
im planning to give
SORT FIELDS=(......)
INCLUDE COND =
SORT FILEDS=COPY
Back to top
View user's profile Send private message

muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Wed Aug 22, 2007 5:07 pm    Post subject: Reply to: Sort two files and copy them in a single step
Reply with quote

did you make a try and what was the result you got? icon_question.gif
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Aug 22, 2007 5:11 pm    Post subject:
Reply with quote

rohitcognizant
1. Do you want to SORT and combine the 2 i/p files to one o/p file?
2. Show some example of what you wanted to do? like i/p and o/p records and there details(sample)
3. In the SORT card you show 2 SORT statement's icon_rolleyes.gif
Back to top
View user's profile Send private message
rohitcognizant

New User


Joined: 13 Feb 2007
Posts: 55
Location: Pune India

PostPosted: Wed Aug 22, 2007 5:49 pm    Post subject:
Reply with quote

no i have not tried it out i just wanted to know if that is possible or not...

ok as i cant give two sort statements in one sortcard , how can i carry out this opereation..wot i have is two files having same layouts with header and trailers ..I
have to first remove the header and trailer(that can be done using sort as the first letters of header and trailer will be PIM always).

Then i need to combine all the other records in both the files and make it into a common file.
can i do that??
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Aug 22, 2007 5:57 pm    Post subject:
Reply with quote

rohitcognizant wrote:
wot i have is two files having same layouts with header and trailers ..I
have to first remove the header and trailer(that can be done using sort as the first letters of header and trailer will be PIM always).

Then i need to combine all the other records in both the files and make it into a common file.
can i do that??
Probably, but as long as you are satified with giving out hints as to what you need/want, it will be hard to say for sure....
A couple examples of both your input files and examples of (both?) your output files would be a nice beginning....
Lrecls & recfms? key locations?
Back to top
View user's profile Send private message
rohitcognizant

New User


Joined: 13 Feb 2007
Posts: 55
Location: Pune India

PostPosted: Wed Aug 22, 2007 6:43 pm    Post subject:
Reply with quote

ok the first file has somethging like this

PIM 20070820
002 reece north carolina 300000
003 randy california 400000
PIM 56343999

the second file has contents
PIM 20070820
002 dwayne washington 300000
003 randy charlton 400000
PIM 45634999

i want to make it into a single file having the contents.
002 dwayne washington 300000
003 debra charlton 400000
002 reece north carolina 300000
003 randy california 400000

i juust want to sort the contents in the two files(by the second field "name"
) and get it into an output file without the header and trailer.can i do it in one single step of sorting??
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Aug 22, 2007 7:07 pm    Post subject:
Reply with quote

rohitcognizant wrote:

Code:
PIM 20070820
002 reece  north carolina   300000
003 randy  california       400000
PIM 56343999


the second file has contents
Code:
PIM 20070820
002 dwayne washington       300000
003 randy  charlton         400000
PIM 45634999


i want to make it into a single file having the contents.
Code:
002 dwayne washington       300000
003 debra  charlton         400000
002 reece  north carolina   300000
003 randy  california       400000
Quote:
can i do it in one single step of sorting??
Yes, omit the PIMs and sort on the required field after concatinating the two inputs.......
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 Aug 22, 2007 9:12 pm    Post subject:
Reply with quote

Quote:
juust want to sort the contents in the two files(by the second field "name"


The output you show is NOT sorted that way. But to give you the idea, the DFSORT job you want would be something like this:

Code:

//S1    EXEC  PGM=ICEMAN                       
//SYSOUT    DD  SYSOUT=*                       
//SORTIN DD DSN=...  input file1
//   DD DSN=...  input file2                                   
//SORTOUT DD DSN=...   output file                           
//SYSIN    DD    *                             
  OMIT COND=(1,3,CH,EQ,C'PIM')                 
  OPTION EQUALS                                 
  SORT FIELDS=(p,m,CH,A)                       


where p,m is the starting position and length of the field you want to sort on.
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 Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 4 Mon Mar 27, 2017 3:59 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


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