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: 2482
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: 2482
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: 2482
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 PKZIP - extracting multiple txt files drarem All Other Mainframe Topics 3 Tue Jul 07, 2020 8:47 pm
No new posts Print next line strings when a condit... tgmuntor DFSORT/ICETOOL 9 Wed May 20, 2020 9:08 pm
No new posts Compare multiple files using JCL/Rexx... tanvi110788 JCL & VSAM 4 Tue May 19, 2020 5:47 pm
No new posts Need help to concatenate files with w... ssuthagar All Other Mainframe Topics 3 Fri May 15, 2020 1:39 am
No new posts Java Batch launcher JVMPRC86 does not... harisukumaran IBM Tools 2 Wed Apr 15, 2020 12:37 am

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