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
 

 

splitting of files according to condition
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
snehasai

New User


Joined: 14 Nov 2008
Posts: 23
Location: bangalore

PostPosted: Tue Nov 18, 2008 1:43 pm    Post subject: splitting of files according to condition
Reply with quote

Hi,

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.

Hope am clear with requirement.

here my JCL included.

//STEP01 EXEC PGM=SORT,PARM='VLTESTI=1'
//SYSOUT DD SYSOUT=*
//T1 DD DSN=&&T1,DISP=(,PASS)
//SORTIN DD DSN=OSBS.ECOMERCE.SNGLFEED.TO.EDI,DISP=SHR
//SYSIN DD *
OPTION COPY
INCLUDE COND=(5,3,CH,EQ,C'END',AND,37,9,ZD,GE,30000)
OUTFIL FNAMES=T1,NULLOFL=RC4,
BUILD=(C'CNT,',37,9,ZD,DIV,+2,M11,LENGTH=9,80:X),CONVERT
//********************************************************************
//STEP02 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&T1,DISP=(OLD,PASS)
//SORTIN DD DSN=OSBS.ECOMERCE.SNGLFEED.TO.EDI,DISP=SHR
//OUT1 DD DSN=BO1142.OSBS.TEST.ECOMERCE.SNGLFEED.TO.EDI1,
// DISP=(NEW,CATLG),
// DCB=(RECFM=VB,LRECL=744,BLKSIZE=0),
// SPACE=(CYL,(25,25),RLSE)
//OUT2 DD DSN=BO1142.OSBS.TEST.ECOMERCE.SNGLFEED.TO.EDI2,
// DISP=(NEW,CATLG),
// DCB=(RECFM=VB,LRECL=744,BLKSIZE=0),
// SPACE=(CYL,(25,25),RLSE)
//SYSIN DD *
OPTION COPY
OMIT COND=(5,3,CH,EQ,C'END')
INREC BUILD=(1,4,SEQNUM,9,ZD,14:5)
OUTFIL FNAMES=OUT1,REMOVECC,
INCLUDE=(5,9,ZD,LE,CNT),BUILD=(1,4,5:14),
TRAILER1=(C'END FEED=ORDER CLIENT=301 LINES=',COUNT+1=(M11,LENGTH=9))
OUTFIL FNAMES=OUT2,REMOVECC,
INCLUDE=(14,3,CH,EQ,C'BEG',OR,5,9,ZD,GT,CNT),BUILD= (1,4,5:14),
TRAILER1=(C'END FEED=ORDER CLIENT=301 LINES=',COUNT+1=(M11,LENGTH=9))
//***********************************************************
//STEP03 EXEC PGM=SORT,COND=(4,GT)
//SYSOUT DD SYSOUT=*
//T1 DD DSN=&&T1,DISP=(,PASS)
//SORTIN DD DSN=OSBS.ECOMERCE.SNGLFEED.TO.EDI,DISP=SHR
//SORTOUT DD DSN=BO1142.OSBS.TEST.ECOMERCE.SNGLFEED.TO.EDI0,
// DISP=(NEW,CATLG),
// DCB=(RECFM=VB,LRECL=744,BLKSIZE=0),
// SPACE=(CYL,(25,25),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
/*
**************************** Bottom of Data *******************

Please help me out in this...
Thanks,
snehasai
Back to top
View user's profile Send private message

snehasai

New User


Joined: 14 Nov 2008
Posts: 23
Location: bangalore

PostPosted: Tue Nov 18, 2008 1:56 pm    Post subject: split on record count of i/p file
Reply with quote

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.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Tue Nov 18, 2008 5:45 pm    Post subject:
Reply with quote

Hello,

What happened to the other topic where your original requirement was posted ? I just did a search and the topic seems to be just disappeared?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Tue Nov 18, 2008 5:54 pm    Post subject:
Reply with quote

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.
Back to top
View user's profile Send private message
snehasai

New User


Joined: 14 Nov 2008
Posts: 23
Location: bangalore

PostPosted: Tue Nov 18, 2008 5:55 pm    Post subject: deleted
Reply with 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...but after i saw that
its not present. icon_sad.gif
Back to top
View user's profile Send private message
snehasai

New User


Joined: 14 Nov 2008
Posts: 23
Location: bangalore

PostPosted: Tue Nov 18, 2008 5:59 pm    Post subject: how to code condition
Reply with quote

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.
Back to top
View user's profile Send private message
snehasai

New User


Joined: 14 Nov 2008
Posts: 23
Location: bangalore

PostPosted: Tue Nov 18, 2008 6:17 pm    Post subject:
Reply with quote

Code:

//STEP01  EXEC PGM=SORT,PARM='VLTESTI=1'
//SYSOUT    DD SYSOUT=*
//T1        DD DSN=&&T1,DISP=(,PASS)
//SORTIN    DD DSN=BM7168.OSBT983L.ECOMERCE.SNGLFEED.TO.EDI,DISP=SHR
//SYSIN     DD *
  OPTION COPY
  INCLUDE COND=(5,3,CH,EQ,C'END',AND,37,9,ZD,GE,30000)
  OUTFIL FNAMES=T1,NULLOFL=RC4,
         BUILD=(C'CNT,',37,9,ZD,DIV,+2,M11,LENGTH=9,80:X),CONVERT
//*****************************************************
//STEP02  EXEC PGM=SORT,COND=(4,LE)
//SYSOUT    DD SYSOUT=*
//SYMNAMES  DD DSN=&&T1,DISP=(OLD,PASS)
//SORTIN    DD DSN=BM7168.OSBT983L.ECOMERCE.SNGLFEED.TO.EDI,DISP=SHR

....... so on
OK... if i submitted by giving condition i got exact o/p

Instead of PARM='VLTESTI=1' ,NULLOFL=RC4,
is there other thing to give. And you specified 37,9,ZD,GE,30000 why only 37,9 is given??

and in step02 why this BUILD=(1,4,5:14), is used
can you make it clear please...
Back to top
View user's profile Send private message
snehasai

New User


Joined: 14 Nov 2008
Posts: 23
Location: bangalore

PostPosted: Tue Nov 18, 2008 6:22 pm    Post subject: sorry
Reply with quote

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.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Tue Nov 18, 2008 6:27 pm    Post subject:
Reply with quote

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. icon_eek.gif
Back to top
View user's profile Send private message
snehasai

New User


Joined: 14 Nov 2008
Posts: 23
Location: bangalore

PostPosted: Tue Nov 18, 2008 6:43 pm    Post subject: worried so....
Reply with quote

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...icon_sad.gif

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.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Tue Nov 18, 2008 6:59 pm    Post subject:
Reply with quote

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?
Back to top
View user's profile Send private message
snehasai

New User


Joined: 14 Nov 2008
Posts: 23
Location: bangalore

PostPosted: Tue Nov 18, 2008 7:12 pm    Post subject:
Reply with quote

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.

Am i clear for the thing u asked.
Back to top
View user's profile Send private message
snehasai

New User


Joined: 14 Nov 2008
Posts: 23
Location: bangalore

PostPosted: Tue Nov 18, 2008 7:15 pm    Post subject:
Reply with quote

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
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Tue Nov 18, 2008 7:33 pm    Post subject:
Reply with quote

Quote:
what condition should be given to step03 to execute after step2 is passsed.
Code:
STEP02 ---COND=(4,LE,STEP01)
STEP03 ---COND=(4,NE,STEP01)
STEP04 ---COND=(0,NE,STEP01)
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Nov 18, 2008 7:40 pm    Post subject: Reply to: splitting of files according to condition
Reply with quote

why stick to the unclear COND construct...

every time I have to look at the manual because I never remember ....
if the cond is true is the step executed or not icon_question.gif 12.gif

use the much more clear and understandable // IF
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Tue Nov 18, 2008 7:41 pm    Post subject:
Reply with quote

The folks who maintain what you've written will appreciate your using the IF/THEN/ELSE/ENDIF construct.
Back to top
View user's profile Send private message
snehasai

New User


Joined: 14 Nov 2008
Posts: 23
Location: bangalore

PostPosted: Tue Nov 18, 2008 7:43 pm    Post subject:
Reply with quote

hI ARUN,
Thanks alot for the help till now...i got my o/p.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Tue Nov 18, 2008 7:48 pm    Post subject:
Reply with quote

Quote:
every time I have to look at the manual because I never remember

I thought everybody had good memory like me. icon_lol.gif
Back to top
View user's profile Send private message
snehasai

New User


Joined: 14 Nov 2008
Posts: 23
Location: bangalore

PostPosted: Wed Nov 19, 2008 8:05 am    Post subject: clarify my doubts
Reply with quote

hi,

Could you explain me what does the below ones does...

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 ?

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?

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?

4.and in step02 y this BUILD=(1,4,5:14), is used and why INCLUDE=(14,3..14 is only used..

Please clear my doubts.

5.what does M11 mean and what does it do.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Wed Nov 19, 2008 2:24 pm    Post subject:
Reply with quote

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.
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 -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm


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