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 

Syncsort solution required

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


Joined: 04 Aug 2005
Posts: 41
Topics: 16

PostPosted: Fri Jul 29, 2011 1:17 pm    Post subject: Syncsort solution required Reply with quote

Hi,

Below is my requirement.

the first 3bytes is the product code and next 10 bytes is the account number.

Input file

0012200113323
2802200123325
0013890054321
0104455789012
2806045322917
0018807389368

Now I wanted to copy the first 1000 accounts for each product type into the output file.
If a product is having more than 1000 accounts ignore the 1001 th account and proceed with the next product type.

My input file is sorted on account number.

Thanks
Mahesh
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Fri Jul 29, 2011 2:00 pm    Post subject: Reply with quote

How many input files are there? Is ther one "control file" and another file with the data?

If there is only one input file, what has been posted?

How many records are in the "data" file?
_________________
All the best,

di
Back to top
View user's profile Send private message
Sqlcode
Intermediate


Joined: 15 Dec 2006
Posts: 157
Topics: 38

PostPosted: Fri Jul 29, 2011 2:16 pm    Post subject: Reply with quote

mahesh_chv,
Assuming 80 byte input and product type being CH and account number being ZD.Tested on DFSort. See if below works...

You mentioned that your input file is already sorted on account number, if you could change previous sort to product type and then account number, you wouldn't have to resort the file again in this step.
Code:
//STEP0001 EXEC PGM=SORT                       
//SORTIN   DD  YOUR INPUT FB/80                 
//SORTOUT  DD  OUTPUT FB/80                     
//SYSIN    DD  *                               
  SORT FIELDS=(1,3,CH,A,4,10,ZD,A),EQUALS       
  OUTREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,3))
  OUTFIL INCLUDE=(81,8,ZD,LE,100)               
/*                                             
//SYSOUT   DD  SYSOUT=*                         
//SYSUDUMP DD  SYSOUT=D                         
//*

Thanks,
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Fri Jul 29, 2011 2:54 pm    Post subject: Reply with quote

Code:
//SYSOUT   DD  SYSOUT=*                         
//SYSUDUMP DD  SYSOUT=D   


Still like that sysusump, do ya. . . . Smile

And if the Syncsort version in use is current enough, the OUTREC / OVERLAY should be fine.
_________________
All the best,

di
Back to top
View user's profile Send private message
Sqlcode
Intermediate


Joined: 15 Dec 2006
Posts: 157
Topics: 38

PostPosted: Fri Jul 29, 2011 3:10 pm    Post subject: Reply with quote

Quote:
Still like that sysusump, do ya. . . .
Didn't understand. It helps when the sort job abends.

Quote:
And if the Syncsort version in use is current enough, the OUTREC / OVERLAY should be fine.

Are you saying SORT FIELDS=(1,3,CH,A,4,10,ZD,A),EQUALS is not required? If yes, I added so because OP's file is sorted on account number and not on the product code . He needs 100 occurences for each product code and not the account number.

Thanks,
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Fri Jul 29, 2011 4:08 pm    Post subject: Reply with quote

Quote:

Didn't understand. It helps when the sort job abends.
I was attempting to be humorous - i may have you confused with someone else from another forum(who would have understood) Embarassed
Quote:

Tested on DFSort. See if below works...

Quote:
Are you saying SORT FIELDS=(1,3,CH,A,4,10,ZD,A),EQUALS is not required?
No, i was saying that i believe your solution will work if the release of Syncsort is current enough. I don't have a way to test this with Syncsort now.
_________________
All the best,

di
Back to top
View user's profile Send private message
Sqlcode
Intermediate


Joined: 15 Dec 2006
Posts: 157
Topics: 38

PostPosted: Fri Jul 29, 2011 4:13 pm    Post subject: Reply with quote

Oh...ok..makes sense now...

That someone else from another forum is indeed me but (this is funny), I didn't know if you are there, on another forum.

Thanks,
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Jul 29, 2011 4:15 pm    Post subject: Reply with quote

Quote:
Didn't understand. It helps when the sort job abends.


sqlcode,

I had suggested to you in another thread (on DFSORT) that it was better not to include the //SYSUDUMP DD. A SYSUDUMP is only useful if you can use the dump to debug an error which would normally require having the source code (e.g. DFSORT code) to look at. A SYSUDUMP isn't much use for a system abend such as Sx37 or Sx22. If you really needed a SYSUDUMP for a failing job, you could add it and rerun. Some shops actually suppress SYSUDUMPs for certain ABENDS such as Sx22.

But if you really like having a //SYSUDUMP DD, that's your choice.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Sqlcode
Intermediate


Joined: 15 Dec 2006
Posts: 157
Topics: 38

PostPosted: Fri Jul 29, 2011 4:31 pm    Post subject: Reply with quote

Frank,
I completely misunderstood SYSUDUMP from your earlier post on other forum. I didn't realize one would have to have DFSort source code to debug the error in the event of an abend. I had it confused with SORTDIAG.

This is clear now as I ran a test job with and without SYSUDUMP, compared sysout messages.

Thanks.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Jul 29, 2011 4:43 pm    Post subject: Reply with quote

There might be a few abends that you could debug without the source code by looking at the storage and registers dumped by SYSUDUMP. For example, if you got an S0C7, you might be able to figure out what the "bad" data looked like by decoding the instruction the PSW pointed at and looking at where the registers pointed. But, in general, you need compiled listings for a SYSUDUMP to be useful.

Note that a SYSUDUMP would be useful if you were calling DFSORT from your own program or using your own exit, and the ABEND occurred in your program or exit. But with PGM=SORT, a SYSUDUMP isn't usually helpful except to the developers or service people.

SORTDIAG messages can be useful, especially if you show them to me or Kolusu. Wink
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mahesh_chv
Beginner


Joined: 04 Aug 2005
Posts: 41
Topics: 16

PostPosted: Tue Aug 02, 2011 11:50 am    Post subject: Reply with quote

Thanks sqlcode...... your solution worked for me....but the sequence number got added at the end of the file which i have to skip using BUILD Smile
Back to top
View user's profile Send private message
mahesh_chv
Beginner


Joined: 04 Aug 2005
Posts: 41
Topics: 16

PostPosted: Tue Aug 02, 2011 11:51 am    Post subject: Reply with quote

sorry...not end of file....end of each record....
Back to top
View user's profile Send private message
Sqlcode
Intermediate


Joined: 15 Dec 2006
Posts: 157
Topics: 38

PostPosted: Tue Aug 02, 2011 4:09 pm    Post subject: Reply with quote

mahesh_chv,
Yes,I missed that in my original post.

Thanks.
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