I have posted this requirement already its splitting i/p file into exactly half.
But condition is.. I have my i/p file records of 37 > 30000 cond'n is wrong so it should bypass 1st 2 steps and execute only last step.
in similar way, if i have i/p file has records 35000 > 30000 here cond'n is right so it should split file. in first two steps and bypass 3rd step.
Hi,
The condition over here is
INCLUDE COND=(5,3,CH,EQ,C'END',AND,37,9,ZD,GE,30000) is not working i suppose.
IT is just splitting the file even if am having less records or more records also,so i need to split only if my i/p file record count < 30000 other wise it should not split the file and bypass 1st 2 steps and execute only last step.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Quote:
INCLUDE COND=(5,3,CH,EQ,C'END',AND,37,9,ZD,GE,30000) is not working i suppose.
Why would you think that it's not working? Please explain the logic you're trying to implement.
Quote:
IT is just splitting the file even if am having less records or more records also,so i need to split only if my i/p file record count < 30000 other wise it should not split the file and bypass 1st 2 steps and execute only last step.
You might have got return codes of '0' and '4' for the two scenarios that can happen. Please note that the actual splitting is done in your 2nd step where you've not given any condition codes and that explains why your file's getting splitted always.
hi arun,
That was been deleted...by a person as i just asked how to delete..but later asked not to delet as i have queries still on this...but after i saw that
its not present.
So i think that 1st step we can do is count the total num of records in i/p file using
OPTION COPY
OUTFIL NODETAIL,REMOVECC,
TRAILER1=(COUNT=(M11,LENGTH=9))
and in step02 i can specify condition that if count< 30000 dont split and execute lst step and if count > 30000 execute step2,3 skip last step.
Sorry I didn't posted this query in previous one...
1.1st query is, instead of PARM='VLTESTI=1' ,NULLOFL=RC4,
is there other thing to give. and what if not given,and why is given
2.And you specified 37,9,ZD,GE,30000 why only 37,9 is given?? what does it do?
3.and in step02 y this BUILD=(1,4,5:14), is used
4.what does M11 mean and what does it do.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Quote:
OK... if i submitted by giving condition i got exact o/p arun...thanksssssss
You're welcome. But I m not clear what you're doing in step03. Instead I was assuming 2 file sending steps wherein you would execute either of the one based on step01 RC.
Quote:
hi arun,
That was been deleted...by a person as i just asked how to delete..but later asked not to delet as i have queries still on this.
I ws just wondering why would you ask how to delete an entire topic which would have been useful to somebody else later.
hi arun,
As that my requiremnt if any of my team looks over that POST which i did, i don't know what their response would be..so as am new to company i don't know that can i disclose something like that or not..so was just afraid...
And am using step03 the one i posted is in wrong way but..actually if step01 file dosent split then step02 shld bypass n step03 should execute in which there is main file that we send to business.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Quote:
actually if step01 file dosent split then step02 shld bypass n step03 should execute in which there is main file that we send to business.
That's fine for step01 returning '4'. But what if step01 gives an RC=0, step02 executes and splits the files? Dont you want to send the splitted files? Do you have an extra step doing this?
If step01 returning '4'. then step02 dosent execute and will not split the file, so that i should write a step3 with main file i/p file which is used in step01 so that step03 shld execute which is not splitted file this is the one we send to business. SO what condition should be given to step03 to execute after step2 is passsed.
and If step01 returning '0'. then step02 shld execute and shld split the file, for this also i should write another step4 with splitted 2 files which we got in step2,so that ste1,2,4 shld execute by bypassing step3 that shld be sending to business. SO what condition should be given to step2/3/4 to execute and send splitted files in step4
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Quote:
1.1st query is, instead of PARM='VLTESTI=1' ,NULLOFL=RC4,
is there other thing to give like COND parameter and what if not given,and why is given ?
VLTESTI=1 is to handle short records during comparison in INCLUDE processing. NULLOFL='4' causes Syncsort to return '4' if the OUTFIL file is empty.
Quote:
2. in INCLUDE COND=(5,3, y u have taken 5,3 as trailer part starts from 1st column only is it coz of VB?
Yes, first 4 bytes of a VB file is reserved for RDW to store the record length.
Quote:
3.And you specified 37,9,ZD,GE,30000 why only 37,9 is given?Is that for triler count u gave that if so it shld start from 32,9 na?
Your trailer count starts at 37th position.
Quote:
4.and in step02 y this BUILD=(1,4,5:14), is used and why INCLUDE=(14,3..14 is only used..
First sort finds the half of the total record-count(CNT) if it's > 30000. Second sort puts a seq-num for all the records and then selects records with seq-num LE CNT into OUT1 and the rest of the records into OUT2 along with header records. BUILD is used to omit the seq-numbers after INCLUDE processing.
Quote:
5.what does M11 mean and what does it do.
COUNT+nnn produces a result of length=15. M11 is a predefined edit mask to get the count in the required format.
PS. All these are clearly mentioned in the Syncsort Manual. Go through the manual for better understanding. If you don't have one, you can ask Alissa to get you one.
Hi.
I have opening this query again coz..i need to split the i/p file into 3 o/p files instead of 2 so in step1, the condition will be DIV, +3,but how the count will be taken in step 2 for INCLUDE condition ...can u please explain me, its urgent..
//STEP001 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//T1 DD DSN=&&T1,DISP=(,PASS)
//SORTIN DD DSN=OSB.&ENV..ECOMERCE.SNGLFEED.TO.EDI(0),
// DISP=SHR
//SYSIN DD *
OPTION COPY
INCLUDE COND=(5,3,CH,EQ,C'END',AND,37,9,ZD,GE,300000)
OUTFIL FNAMES=T1,NULLOFL=RC4,
BUILD=(C'CNT,',37,9,ZD,DIV,+3,M11,LENGTH=9,80:X),CONVERT
//*
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
snehasai,
I have modified the cards as below. Here you'll have 2 counts-CNT1(one-third of total count) and CNT2(two-third of total count) getting written in first step and which is subsequently used in the succeeding step.
Sort1
Code:
OPTION COPY
INCLUDE COND=(5,3,CH,EQ,C'END',AND,37,9,ZD,GE,00005)
OUTFIL FNAMES=T1,NULLOFL=RC4,
BUILD=(C'CNT1,',37,9,ZD,DIV,+3,M11,LENGTH=9,/,
C'CNT2,',37,9,ZD,MUL,+2,DIV,+3,M11,LENGTH=9,80:X),CONVERT
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
snehasai,
I m sorry, My test was with around 20 records; hence gave the count in the first sort as 00005. You can change it to 300000 as in your case. Try this and post back if you face any issues.
Code:
INCLUDE COND=(5,3,CH,EQ,C'END',AND,37,9,ZD,GE,300000)