Posted: Wed Feb 11, 2009 5:03 am Post subject: Variable lentgh file - sort
Hi,
I've a scenario where I need to create a output file either by program or through JCL. I know that we can do it through SORT. But not sure how to do it. Please help me how to do it. If possible sample sort steps.
The requirement is as below
Quote:
I need to read in a client control card and extract all records where the first 2 positions of the file uto.cb160s01.cycrpt(0) which is variable length file , equal the company's in the client control card. The output file needs to be variable length.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Feb 11, 2009 10:53 am Post subject:
Sigh. PGM=ICEMAN and PGM=SORT are equivalent. Both call your sort product. You can change PGM=ICEMAN to PGM=SORT if you like, but it will work exactly the same. _________________ 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
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Feb 11, 2009 11:42 am Post subject:
nadh wrote:
Thankyou.
I've one doubt..
Code:
OUTFIL BUILD=(C' SORT FIELDS=COPY',/,
C' INCLUDE COND=(5,2,CH,EQ,C''',1,2,C'''',80:X)
- do i need to add one ')' here?
what is the use of 80:X in this.
Nadh,
Please copy the control cards carefully. You don't need the ')' as we are creating it in the control card itself. For DFSORT SYSIN data set must be defined with a RECFM of F or FB. The LRECL can be 80, or more (when valid). If the LRECL is greater than 80, DFSORT will use the first 80 bytes of each record. 80:X will create a byte file padding with spaces upto 80 bytes.
I tested it today after I got input dataset. It worked wonderfully. But Client Control card changed. Now it will be like
Quote:
##sample01 11
##sample01 09
Number of rows in control card will be variable. I need to extract all the records from the input file where first 2 positions are equal to 11 and 09....to output file.
Please provide what changes do I need to do in sysin cards to do this.
It worked wonderfuly. Thankyou so much. Could you please tell what is the use of 15X.
Kolusu there is a little change, now I need to extract all the records where the first 2 positions of the i/p file are equal to '01' or '09' and where position 3 and 4 are equal to the companys in the client control card. Also I need to include the header record in the input file which will have low values in position 1 and 2.
Sample data in input file is as below...
Thankyou so much. Could you please tell what is the use of 15X.
Just to align the control cards.Look at the sysout from step0200 and you will see the generated control cards.
Code:
INCLUDE COND=(5,2,CH,EQ,X'0000',OR,
(5,2,SS,EQ,C'01,09',AND,
5,2,CH,EQ,C'11',OR,
5,2,CH,EQ,C'09',OR,
1,1,CH,NE,1,1,CH))
if you see the first line which has include cond and the seconds lines don't have anything. So just to align and better readability, I padded the second record onwards with 15 spaces so that p,m,f,eq are all aligned together
Without 15x it would look like this.I don't like this kind of formating
Code:
INCLUDE COND=(5,2,CH,EQ,X'0000',OR,
(5,2,SS,EQ,C'01,09',AND,
5,2,CH,EQ,C'11',OR,
5,2,CH,EQ,C'09',OR,
1,1,CH,NE,1,1,CH))
Thankyou verymuch. The above code is working but its only retriving the records which are having only 09 in input file. I need to extract the records which are having 01 in input file. Please help me out. what is the use of SS in include condition.
Thankyou Kolusu. I've tried with that code. But still its giving all the records which are having '09' in 3,4 positions. I should extract all the records which are having either 01 or 09 in position 1,2 and having 3,4 positions equal to client control card. If 3,4 positions are equal to client control card and 1,2 positions are not equal to 01 or 09 then that record should not be extracted. The above INCLUDE COND is acting as its retriving all the records having 01 or 09 in positons 1,2 and having 11 in position 3,4 and its retriving all the records having 09 in positions 3,4 irrespective of values in position 1,2. Please help me out.
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