MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

E35 routines!!

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Papz
Beginner


Joined: 28 Jul 2004
Posts: 11
Topics: 2

PostPosted: Wed Jul 28, 2004 6:32 am    Post subject: E35 routines!! Reply with quote

Hi ,
Can anyone help me out how to execute a sort with E35.
I need to split a file based on some customer id.

I/P file is of RECFM - V with lrecl 54
and i need 10 o/p files with the same DCB
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jul 28, 2004 7:18 am    Post subject: Reply with quote

papz,

Check this link to "DFSORT Application Programming Guide" which explains in detail about User exits along with examples

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA00/4.0?DT=20031124143823

Quote:

I need to split a file based on some customer id. I/P file is of RECFM - V with lrecl 54
and i need 10 o/p files with the same DCB


hmm I don't think you need an exit to split the file unless you intend to do something complex.

check the following links which discuss about splitting the input file.

http://www.mvsforums.com/helpboards/viewtopic.php?t=2584&highlight=split
http://www.mvsforums.com/helpboards/viewtopic.php?t=2371&highlight=split
http://www.mvsforums.com/helpboards/viewtopic.php?t=2127&highlight=split
http://www.mvsforums.com/helpboards/viewtopic.php?t=1192&highlight=split
http://www.mvsforums.com/helpboards/viewtopic.php?t=12&highlight=split
http://www.mvsforums.com/helpboards/viewtopic.php?t=61&highlight=split

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Papz
Beginner


Joined: 28 Jul 2004
Posts: 11
Topics: 2

PostPosted: Wed Jul 28, 2004 7:23 am    Post subject: Reply with quote

Thanks kolusu..
I will go thru the links, My basic requirement is to split a very large file into 10 different files with respect to a table which is partioned based on the key..
This is done so that i can run parallel jobs with those datasets.

Thanks,
Papz
Back to top
View user's profile Send private message
Papz
Beginner


Joined: 28 Jul 2004
Posts: 11
Topics: 2

PostPosted: Wed Jul 28, 2004 7:37 am    Post subject: Reply with quote

is there a better way to do this kolusu..
We have got a dataset which contains info regarding the cusomerid and the partition its attached to.So what we are trying to do in our exit routine is trying to read each i/p record and checking to which partition it belongs and then writing it intothe corresponding DSN.
we can acheive this by a cobol program too but someone from our team had suggested the possibility of an E35 exit routine!!
Is is faster ?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jul 28, 2004 7:53 am    Post subject: Reply with quote

Papz,

If you know the customer ID's then it is very easy to split the files.for ex:

Code:

//STEP0100 EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD *                                                   
CUST 1                                                             
CUST 1                                                             
CUST 2                                                             
CUST 2                                                             
CUST 3                                                             
CUST 3                                                             
CUST 3                                                             
CUST 4                                                             
CUST 4                                                             
CUST 4                                                             
CUST 4                                                             
CUST 5                                                             
CUST 5                                                             
//CUST1    DD DSN=YOUR 1ST OUTPUT FILE
//CUST2    DD DSN=YOUR 2ND OUTPUT FILE
//CUST3    DD DSN=YOUR 3RD OUTPUT FILE
//CUST4    DD DSN=YOUR 4TH OUTPUT FILE
//CUST5    DD DSN=YOUR 5TH OUTPUT FILE
//SYSIN    DD  *                                                   
  SORT FIELDS=COPY                                                 
  OUTFIL FNAMES=CUST1,INCLUDE=(1,4,CH,EQ,C'CUST',AND,6,1,CH,EQ,C'1')
  OUTFIL FNAMES=CUST2,INCLUDE=(1,4,CH,EQ,C'CUST',AND,6,1,CH,EQ,C'2')
  OUTFIL FNAMES=CUST3,INCLUDE=(1,4,CH,EQ,C'CUST',AND,6,1,CH,EQ,C'3')
  OUTFIL FNAMES=CUST4,INCLUDE=(1,4,CH,EQ,C'CUST',AND,6,1,CH,EQ,C'4')
  OUTFIL FNAMES=CUST5,INCLUDE=(1,4,CH,EQ,C'CUST',AND,6,1,CH,EQ,C'5')
/*                                                                 


If this job does not satisfy your requirement, please post a sample of your Input and desired output along with DCB parameters of both input and output

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Papz
Beginner


Joined: 28 Jul 2004
Posts: 11
Topics: 2

PostPosted: Wed Jul 28, 2004 8:20 am    Post subject: Reply with quote

Input files:

FILE 1 : (RECFM = FB,LRECL = 25)
CUSTOMER ID : 9(12)
FILLER : X(5)
PARTITION : X(8 )

sample:
Code:

123456789011     DMM2MSP1
123456789012     DMM2MSP2
123456789013     DMM2MSP3
123456789022     DMM2MSP2
123456789023     DMM2MSP3

FILE 2: (RECFM = VB,LRECL = 54)
54 INCLUDING RDW..
XXXXXXXX-CUST ID-XXXXXXXXXXXXXXXXX

OUTPUT FILES needed based on partitions , the DCB remaining the same as FILE 2
three files( based on partitions) need to be created with values like:

O/P FILE 1:

XXXXXXXX-CUST ID-XXXXXXXXXXXXXXXXX (from I/P FILE 2)Where this record is with cust-id from partition DMM2MSP1
and so on
The sort must create 3 files(ie for each partition) with E35 exit routine.

Hope I have not confused you kolusu..

Thanks,
Papz
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jul 28, 2004 8:36 am    Post subject: Reply with quote

Papz,

Papz,

How big is FILE 1(the FB recfm file )? i.e what is the total no: of records in the file?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Papz
Beginner


Joined: 28 Jul 2004
Posts: 11
Topics: 2

PostPosted: Wed Jul 28, 2004 8:40 am    Post subject: Reply with quote

It has around 999 records and I am anyway going to load it into an internal table
Thanks!
Papz
Back to top
View user's profile Send private message
Papz
Beginner


Joined: 28 Jul 2004
Posts: 11
Topics: 2

PostPosted: Wed Jul 28, 2004 8:42 am    Post subject: Reply with quote

I ran a sample pgm E35 and am getting an abend stating:
There was an unsuccessful OPEN or CLOSE of file IDLRCARD in program.

Can you tell me how can I rectify this ?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jul 28, 2004 9:03 am    Post subject: Reply with quote

Papz,

Since your input FB file has less than 1000 records , the following DFSORT/ICETOOL JCL will give you the desired results. If your shop has syncsort then change the pgm name to synctool. I assumed that the CUSTOMER-ID starts in pos 10 in the VB file. So if you want to extract the records we need to consider the rdw , which makes the position to be 14.

A brief explanation of the job. We first take the FB input file and created dynamic include cards which will be used to extract the records from the vb file.

The second copy step takes in these dynamically created control cards and creates the 3 output files.

Code:

//STEP0100 EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//FB       DD *                                           
123456789011     DMM2MSP1                                 
123456789012     DMM2MSP2                                 
123456789013     DMM2MSP3                                 
123456789022     DMM2MSP2                                 
123456789023     DMM2MSP3                                 
//VB       DD DSN=YOUR INPUT VB FILE,
//            DISP=SHR
//T1       DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE) 
//T2       DD DSN=&T2,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE) 
//T3       DD DSN=&T3,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE) 
//DMM2MSP1 DD DSN=YOUR 1ST PARTITION RECORDS,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(20,20),RLSE)
//DMM2MSP2 DD DSN=YOUR 2ND PARTITION RECORDS,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(20,20),RLSE)
//DMM2MSP3 DD DSN=YOUR 3RD PARTITION RECORDS,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(20,20),RLSE)
//TOOLIN   DD *                                               
  COPY FROM(FB) USING(CTL1)                                   
  COPY FROM(VB) USING(CTL2)                                   
//CTL1CNTL DD *                                               
  OUTFIL FNAMES=T1,INCLUDE=(18,8,CH,EQ,C'DMM2MSP1'),         
  OUTREC=(11X,C'14,12,CH,EQ,C',X'7D',1,12,X'7D',C',OR,',80:X)
  OUTFIL FNAMES=T2,INCLUDE=(18,8,CH,EQ,C'DMM2MSP2'),         
  OUTREC=(11X,C'14,12,CH,EQ,C',X'7D',1,12,X'7D',C',OR,',80:X)
  OUTFIL FNAMES=T3,INCLUDE=(18,8,CH,EQ,C'DMM2MSP3'),         
  OUTREC=(11X,C'14,12,CH,EQ,C',X'7D',1,12,X'7D',C',OR,',80:X)
//CTL2CNTL DD *                                               
  OUTFIL FNAMES=DMM2MSP1,                                     
  INCLUDE=(14,12,CH,EQ,C'TRUE COND   ',OR,                   
//         DD DSN=&T1,DISP=OLD,VOL=REF=*.T1                   
//         DD *                                               
           14,12,CH,EQ,C'FALSE COND  ')                       
//         DD *                                               
  OUTFIL FNAMES=DMM2MSP2,                                     
  INCLUDE=(14,12,CH,EQ,C'TRUE COND   ',OR,                   
//         DD DSN=&T2,DISP=OLD,VOL=REF=*.T2                   
//         DD *                                               
           14,12,CH,EQ,C'FALSE COND  ')                       
//         DD *                                               
  OUTFIL FNAMES=DMM2MSP3,                                     
  INCLUDE=(14,12,CH,EQ,C'TRUE COND   ',OR,                   
//         DD DSN=&T3,DISP=OLD,VOL=REF=*.T3                   
//         DD *                                               
           14,12,CH,EQ,C'FALSE COND  ')                       
/*


Hope this helps...

Cheers

Kolusu

Ps: On the other error you are getting when running an exit, I cannot tell as to what caused the error unless I see the code you are running.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Papz
Beginner


Joined: 28 Jul 2004
Posts: 11
Topics: 2

PostPosted: Wed Jul 28, 2004 9:07 am    Post subject: Reply with quote

Thanks for your help kolusu , I will try out this option too!!

Papz.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group