MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

copying recs from multiple i/ps into a output using sort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
computer
Beginner


Joined: 12 Jun 2007
Posts: 64
Topics: 17
Location: Hyderabad

PostPosted: Sun Sep 02, 2007 6:07 am    Post subject: copying recs from multiple i/ps into a output using sort Reply with quote

Hi All,

My requirement is that I have 3 inps file from which I have to take recs of different positions from 3 files and write into a single output file.
And I have different sort cards for the 3 inps file.

EXAM:
INPUT1:
01 manoj
45 rakesh
89 raja

INPUT2:
99 thila
43 hhh
56 fiki
33 sila

INPUT3:
67 yhik
55 ggg
87 kkk
90 zaf
83 ajj

Now my ouput file sholud contain Rec no 2 to 3 from file1, rec no. 1 to 3 from file2 and rec no. 2-4 from file3 after sort card is applied to the input file.

I have ICETOOL,DFSORT,ICEMAN with me.

Any help is highly appreciated.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sun Sep 02, 2007 10:06 am    Post subject: Reply with quote

It's not clear what you want to do exactly.

What is the RECFM and LRECL of each input file? What is the RECFM and LRECL of the output file?

Quote:
after sort card is applied to the input file.


Do you mean a SORT statement such as:

Code:

   SORT FIELDS=(1,2,CH,A)


or do you mean something else? Is it the same SORT statement for all three files or different SORT statements for the different files? What are the SORT statements you want to use?

Please show the expected output records for your example of input records.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
computer
Beginner


Joined: 12 Jun 2007
Posts: 64
Topics: 17
Location: Hyderabad

PostPosted: Tue Sep 11, 2007 10:25 am    Post subject: Reply with quote

What is the RECFM and LRECL of each input file? What is the RECFM and LRECL of the output file?

The RECFM and LRECL is same for all the files.

Do you mean a SORT statement such as:

Code:

SORT FIELDS=(1,2,CH,A)


Yes Sort cards are different for different files(it may also have include, build or like this)

EXAM:
INPUT1: After Sort card is used(sort fields=1,2,zd,d
01 manoj 89 raja Include cond=....)
45 rakesh 45 rakesh
89 raja 01 manoj


INPUT2: After sort card is used(sort fileds=1,2,zd,a)
99 thila 33 sila include cond=
43 hhh 43 hhh
56 fiki 56 fiki
33 sila 99 thila


INPUT3: After sort card is used (sort fileds=4,10,ch,a)
67 yhik 83 ajj include cond=
55 ggg 55 ggg
87 kkk 87 kkk
90 zaf 67 yhik
83 ajj 90 zaf

Output:


89 raja
45 rakesh
43 hhh
56 fiki
87 kkk
67 yhik
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Tue Sep 11, 2007 10:54 am    Post subject: Reply with quote

computer,

RECFM means the record format - Varible or Fixed length.
LRECL states the record length.

Your requirement is not understandable.
Use [code] [\code] tags to enclose your code.

Please explain in detail what you are actually trying to achieve so that we can provide you with some valuable responses.

Vivek G
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Sep 11, 2007 12:01 pm    Post subject: Reply with quote

Computer,

It's not clear what you want and your description of what you want doesn't really match your input/output example, but I'm guessing you want to SORT each input file and then include specific sorted record numbers from it (e.g. records 2-3). Here's a job that does that and produces the output you show from the input you show:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD *
01 manoj
45 rakesh
89 raja
//IN2 DD *
99 thila
43 hhh
56 fiki
33 sila
//IN3 DD *
67 yhik
55 ggg
87 kkk
90 zaf
83 ajj
/*
//*** Use a MOD data set for //OUT
//OUT DD DISP=MOD,DSN=...   output file
//TOOLIN   DD    *
SORT FROM(IN1) USING(CTL1)
SORT FROM(IN2) USING(CTL2)
SORT FROM(IN3) USING(CTL3)
/*
//CTL1CNTL DD *
  SORT FIELDS=(1,2,ZD,D)
  OUTFIL FNAMES=OUT,ENDREC=2
/*
//CTL2CNTL DD *
  SORT FIELDS=(1,2,ZD,A)
  OUTFIL FNAMES=OUT,STARTREC=2,ENDREC=3
/*
//CTL3CNTL DD *
  SORT FIELDS=(4,10,CH,A)
  OUTFIL FNAMES=OUT,STARTREC=3,ENDREC=4
/*


Note that if you want to include records based on conditions, you can use an INCLUDE=(...) operand on the OUTFIL statement instead of STARTREC and ENDREC.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
computer
Beginner


Joined: 12 Jun 2007
Posts: 64
Topics: 17
Location: Hyderabad

PostPosted: Sun Sep 16, 2007 8:19 am    Post subject: Reply with quote

thanks Frank,
Its working, this what i wanted.......
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group