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 

Creating dynamic control card
Goto page Previous  1, 2
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
kavi
Beginner


Joined: 15 Sep 2006
Posts: 64
Topics: 22

PostPosted: Thu Jan 18, 2007 11:42 pm    Post subject: Reply with quote

Kolusu,
I found the solution in easytrive. But Sort is our requirement please help me SYNCSORT FOR Z/OS 1.2.1.1N
Input file DCB properties
Record format : FB
Record length : 9
output files DCB properties
Record format : FB
Record length : 1552
Position of the field to be compared omited in the output file =17,9
Format=ch
The input file has 9 bytes
123456789
the above 9 bytes will be compared with output file at 17 position and if matched the record has to be removed from the output file.

Thanks in advance
Kavi
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Jan 19, 2007 9:33 am    Post subject: Reply with quote

Kavi,

You have syncsort z/os 1.2 which supports the JOIN feature. Try this

Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*                     
//SORTJNF1 DD DSN=your 9 byte omit cond file,
//            DISP=SHR                     
//SORTJNF2 DD DSN=your 1552 master file,   
//            DISP=SHR                     
//SORTOUT  DD DSN=YOUR OUTPUT FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *                           
  SORT FIELDS=COPY                         
  JOINKEYS FILE=F1,FIELDS=(01,9,A)         
  JOINKEYS FILE=F2,FIELDS=(17,9,A)         
  REFORMAT FIELDS=(F2:0001,1552)
  JOIN UNPAIRED,F2,ONLY                 
/*                                         



Also you can go thru these topics to understand more about Join feature

http://www.mvsforums.com/helpboards/viewtopic.php?t=6801&highlight=joinkeys

http://www.mvsforums.com/helpboards/viewtopic.php?t=4690&highlight=joinkeys



Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu


Last edited by kolusu on Fri Jan 19, 2007 12:34 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Fri Jan 19, 2007 11:18 am    Post subject: Reply with quote

Kavi,

My understanding of the problem now is that you have 2 files. One is the master data file with multiple fields, and the second conatins a single 9-byte field. If this 9-byte field matches position 17,9 in the master file, then it should be removed from the output file. If this is correct, then Kolusu is right in utilizing the JOIN feature. However, I would make a slight change to the SYSIN DD above:

(I apologize for the plain text - I am new to posting and have not yet figured out how to post the pretty JCL image as Kolusu has done for you).
Code:

  SORT FIELDS=COPY                         
  JOINKEYS FILE=F1,FIELDS=(01,9,A)         
  JOINKEYS FILE=F2,FIELDS=(17,9,A)         
  REFORMAT FIELDS=(F2:0001,1552)           
  JOIN UNPAIRED,ONLY,F2                         

This will discard the paired records, keeping only the unpaired records from the master file. (Without the 'ONLY,F2' specified, you could potentially have a record in the 9-byte file that does not match anything in the master file, and would therefore be written to the output file).

If this is not exactly what you were trying to accomplish, please keep me posted and I'll continue to tweak the job for you.
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Fri Jan 19, 2007 11:19 am    Post subject: Reply with quote

Quote:

(Without the 'ONLY,F2' specified, you could potentially have a record in the 9-byte file that does not match anything in the master file, and would therefore be written to the output file).


Let me clarify, the 9-byte record would not be written out, but there would be a blank 1552-byte file.
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Jan 19, 2007 11:24 am    Post subject: Reply with quote

Quote:

(I apologize for the plain text - I am new to posting and have not yet figured out how to post the pretty JCL image as Kolusu has done for you).

amargulies,

It is quite simple. All you have to do post your JCL between BBcodes
{code}
your jcl here
{/code}

Replace the { with [ and you would get that pretty JCL image

Look at this topic for more

http://www.mvsforums.com/helpboards/viewtopic.php?p=19031#19031



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


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

PostPosted: Fri Jan 19, 2007 11:51 am    Post subject: Reply with quote

amargulies wrote:
Quote:

(Without the 'ONLY,F2' specified, you could potentially have a record in the 9-byte file that does not match anything in the master file, and would therefore be written to the output file).


Let me clarify, the 9-byte record would not be written out, but there would be a blank 1552-byte file.


hmm sorry to contradict but If you specify ONLY , wouldn't the job abend as the reformat field is outside the range?

I think you just need

Code:

JOIN UNPAIRED,F2


Another alternative is to add another condition

Code:

  JOIN UNPAIRED
  OUTFIL OMIT=((0017,09,CH,EQ,1553,9,CH),OR,
               (0017,09,CH,EQ,C' ',AND,1553,09,CH,GE,C' ')),
  OUTREC=(01,1552)
/*


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


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Fri Jan 19, 2007 12:25 pm    Post subject: Reply with quote

Quote:

hmm sorry to contradict but If you specify ONLY , wouldn't the job abend as the reformat field is outside the range?

Kolusu,

I did not mean to cause any confusion by the way I posted the JCL. I purposely left out the OUTFIL and OUTREC statements because I did not deem them necessary in this case. Does my example make more sense now?
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Jan 19, 2007 12:33 pm    Post subject: Reply with quote

Quote:

I purposely left out the OUTFIL and OUTREC statements because I did not deem them necessary in this case. Does my example make more sense now?

amargulies,

My Apologies. I did not see that you also changed the Reformat Fields to pick only F2 records.

Thanks for the correction. I am going to correct my prior post

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


Joined: 15 Sep 2006
Posts: 64
Topics: 22

PostPosted: Mon Jan 22, 2007 12:52 am    Post subject: Reply with quote

Thanks to all.
Special thanks to Kolusu for his great solution.
I tried this it helps me lot. Thanks to all.

Thanks
Kavi
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
Goto page Previous  1, 2
Page 2 of 2

 
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