Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
splitting of files according to condition
Goto page Previous  1, 2
 
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 Dec 02, 2008 12:37 pm    Post subject: Reply to: splitting of files according to condition
Reply with quote

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

Arun Raj

Moderator


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

PostPosted: Tue Dec 02, 2008 3:53 pm    Post subject:
Reply with quote

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

Sort2
Code:
 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,CNT1),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,CNT1,AND,               
                                   5,9,ZD,LE,CNT2)),BUILD=(1,4,5:14),
 TRAILER1=(C'END FEED=ORDER CLIENT=301 LINES=',COUNT+1=(M11,LENGTH=9))
 OUTFIL FNAMES=OUT3,REMOVECC,                                         
    INCLUDE=(14,3,CH,EQ,C'BEG',OR,5,9,ZD,GT,CNT2),BUILD=(1,4,5:14),   
 TRAILER1=(C'END FEED=ORDER CLIENT=301 LINES=',COUNT+1=(M11,LENGTH=9))
Back to top
View user's profile Send private message
snehasai

New User


Joined: 14 Nov 2008
Posts: 23
Location: bangalore

PostPosted: Tue Dec 02, 2008 4:06 pm    Post subject: NOt working
Reply with quote

hi arun,
The code dint worked arun, only step1 n step 3 has run...i mean files dint split in step2 and gave maxcc=4
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Dec 02, 2008 4:17 pm    Post subject:
Reply with quote

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

New User


Joined: 14 Nov 2008
Posts: 23
Location: bangalore

PostPosted: Tue Dec 02, 2008 4:19 pm    Post subject: 300000 only i gave
Reply with quote

hi arun,
I gave 300000 only and submitted not 5

Code:
OPTION COPY
INCLUDE COND=(5,3,CH,EQ,C'END',AND,37,9,ZD,GE,300000)
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


Edited: Please use BBcode Tags when You post some code, that's rather readable, Thanks...Anuj
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Dec 03, 2008 1:27 pm    Post subject:
Reply with quote

snehasai wrote:
Quote:
There you're. Your initial requirement told- split the files only when the input record count is > 300,000 and you've got only 188,451 records in input which means "Dont Split". It is working exactly the same way in which you intended to.


Exactly arun.. I dint even look that figure in the sort card... Its perfectly correct thanks arun.
Thanks alotttt icon_biggrin.gif
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 Previous  1, 2
Page 2 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Create Dynamic Sort card with Omit co... balaji81_k DFSORT/ICETOOL 9 Thu Sep 26, 2019 10:06 pm
No new posts Pack to Unpack conversion for sending... A_programmers COBOL Programming 13 Wed Sep 11, 2019 10:46 pm
No new posts Trying to document a weird condition ... John Poulakos CICS 0 Fri Aug 30, 2019 11:19 pm
This topic is locked: you cannot edit posts or make replies. Compare two files logic in COBOL Nishant Singhal COBOL Programming 4 Sun Aug 25, 2019 2:25 am
No new posts Concatenate two files of variable rec... Thiru S DFSORT/ICETOOL 3 Wed Aug 21, 2019 11:53 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us