Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
passing records those positions divisible by one number

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
donisati

New User


Joined: 12 Feb 2008
Posts: 1
Location: Hyderabad

PostPosted: Tue May 27, 2008 1:49 pm    Post subject: passing records those positions divisible by one number
Reply with quote

Hi All,

One input file containg 100 records of length 120,So i need to put all the records those are divisible by 2 in file1 and divisible ny 4 in file2 and remaining are in file 3

how i can do this.......

Thanks & Regards
D.Satheesh
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue May 27, 2008 2:07 pm    Post subject:
Reply with quote

Hi,

please example of the data.


Gerry
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10374
Location: italy

PostPosted: Tue May 27, 2008 3:35 pm    Post subject: Reply to: passing records those positions divisible by one n
Reply with quote

write a program with
one input file
three output files

keep the record counter and carry on the approprate modulus computations
remember to compute the modulo 2 after the modulo 4
otherwise the modulo 4 path will never be taken

write to the output file accordingly

JCL WILL NOT DO IT FOR YOU....
the alternatives are a RYO program ( HLL, easytrieve, SAS, REXX script )
or a &sort family &fileaid family utilkity with the proper processing options
Back to top
View user's profile Send private message
vpr_118
Warnings : 1

New User


Joined: 07 Apr 2008
Posts: 64
Location: chennai

PostPosted: Tue May 27, 2008 3:48 pm    Post subject: Reply to: passing records those positions divisible by one n
Reply with quote

You can use ICEMAN utility.

I am i right you want every fourth and every 2nd record separately in two different files.

//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=(OUT1,OUT2,OUT3,OUT4),SPLIT
/*

OUT4 will have very 4th record and OUT2 will have every second record.

Thanks
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Tue May 27, 2008 5:38 pm    Post subject:
Reply with quote

D.Satheesh,
Please check the below code.

Code:

//PS020    EXEC PGM=SYNCTOOL                                       
//SYSOUT   DD  SYSOUT=*                                           
//TOOLMSG  DD  SYSOUT=*                                           
//DFSMSG   DD  SYSOUT=*                                           
//IN       DD  *                                                   
1                                                                 
2                                                                 
3                                                                 
4                                                                 
5                                                                 
6                                                                 
7                                                                 
8                                                                 
9                                                                 
10                                                                 
11                                                                 
12                                                                 
13                                                                 
14                                                                 
15                                                                 
16                                                                 
17                                                                 
18                                                                 
19                                                                 
20                                                                 
//OUT1     DD  SYSOUT=*                                           
//TEMP     DD  DSN=&&T2,DISP=(,PASS),SPACE=(CYL,(1,2),RLSE)       
//OUT2     DD  SYSOUT=*                                           
//OUT3     DD  SYSOUT=*                                           
//TOOLIN   DD  *                                                   
   SORT FROM(IN) TO(TEMP) USING(CTL1)                             
   COPY FROM(TEMP) USING(CTL2)                                     
//CTL1CNTL DD  *                                                   
   SORT FIELDS=COPY                                               
   INREC FIELDS=(1,5,SEQNUM,8,ZD)                                 
   OUTREC FIELDS=(1,5,6,8,ZD,MOD,+2,EDIT=(TT),1X,                 
                      6,8,ZD,MOD,+4,EDIT=(TT))                     
//CTL2CNTL DD  *                                               
   OPTION COPY                                                 
   OUTFIL FNAMES=OUT1,INCLUDE=(6,2,CH,EQ,C'01'),OUTREC=(1,5)   
   OUTFIL FNAMES=OUT2,INCLUDE=(6,2,CH,EQ,C'00'),OUTREC=(1,5)   
   OUTFIL FNAMES=OUT3,INCLUDE=(09,2,CH,EQ,C'00'),OUTREC=(1,5) 


Code:


out1:
1
3
5
7
9
11
13
15
17
19

out2:

2
4
6
8
10
12
14
16
18
20

out3:
4
8
12
16
20



Thanks
Krishy
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Tue May 27, 2008 6:37 pm    Post subject:
Reply with quote

Hi donisati,

Please check with the following code for your requirement.

Code:
// EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INPUT.FILE,DISP=SHR
//OUT1 DD DSN=OUT1,DISP=...
//OUT2 DD DSN=OUT2,DISP=...
//OUT3 DD DSN=OUT3,DISP=...
//SYSIN DD *
 OPTION COPY
 OUTFIL FNAMES=OUT1,STARTREC=2,SAMPLE=(2,1)
 OUTFIL FNAMES=OUT2,STARTREC=4,SAMPLE=(4,1)
 OUTFIL FNAMES=OUT3,SAVE
/*
//

Thanks,
Shankar
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 4 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Matching and unmatched records!! Vignesh Sid SYNCSORT 3 Thu Nov 09, 2017 11:22 am

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