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 

Split master file into 2 different files in original order.

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


Joined: 25 Aug 2003
Posts: 73
Topics: 29

PostPosted: Thu May 12, 2005 3:40 am    Post subject: Split master file into 2 different files in original order. Reply with quote

Hello Gurus

I cannot trace the error in this simple sort. It gives me a RC of 16.

Need to retrieve 'xxxx' and 'yyyy' type records from position 344 to 347 into 2 files.
I use seqnum so that the order is not disturbed in the resulting files. Appreciate any help.

Quote:
//SPLIT EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=WQORM.T.WQORMD18.WQOROUT2,DISP=SHR
//TEMP1 DD DSN=WQORM.T.WQORMD18.WQOR0010,
// DISP=OLD
//OUT1 DD DSN=WQORM.T.WQORMD18.WQOR0012,
// DISP=OLD
//TOOLIN DD *
COPY FROM(IN1) TO(TEMP1) USING(CTL1)
SORT FROM(TEMP1) TO(OUT1) USING(CTL2)
SORT FROM(TEMP1) TO(OUT2) USING(CTL3)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1,347,348:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
SORT FIELDS=(344,4,CH,A,348,8,ZD,A)
INCLUDE=(344,4,CH,EQ,C'YYYY'),OUTREC FIELDS=(1,343)
/*
//CTL3CNTL DD *
SORT FIELDS=(344,4,CH,A,348,8,ZD,A)
INCLUDE=(344,4,CH,EQ,C'XXXX'),OUTREC FIELDS=(1,343)
/*
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: Thu May 12, 2005 5:48 am    Post subject: Reply with quote

Relaxing,

I am not really sure as why you are adding the seqnum and then running 3 steps to achieve the desired results. The job is pretty simple. You can do it all in one single pass of data.

try this

Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=YOUR INPUT FILE,
//            DISP=SHR
//XXXX     DD DSN=YOUR XXXX RECORDS FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//YYYY     DD DSN=YOUR YYYY RECORDS FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *
  SORT FIELDS=COPY
  OUTFIL FNAMES=XXXX,INCLUDE=(344,4,CH,EQ,C'XXXX'),
  OUTREC=(1,343)
  OUTFIL FNAMES=YYYY,INCLUDE=(344,4,CH,EQ,C'YYYY'),
  OUTREC=(1,343)
/*


Hope this helps...

Cheers

Kolusu

PS: If you want to debug the error , look at the error messages from DFSMSG and then take a look at documentation of INCLUDE verb
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
relaxing
Beginner


Joined: 25 Aug 2003
Posts: 73
Topics: 29

PostPosted: Thu May 12, 2005 6:17 am    Post subject: Reply with quote

thanks kolusu
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