|
View previous topic :: View next topic
|
| Author |
Message |
umanaga
New User
.jpg)
Joined: 09 Apr 2007 Posts: 33 Location: India
|
|
|
|
i have a requirement as below
after sort
02- no of A recs, 01-no of B recs
Currently doing this in 2 steps, once to modify every rec by putting 01 and in second step use sum fields on them. Is it possible to do it in a single step. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Deja vu
With INREC, extend your record to include a value of 1 of the length you need.
Include the new field in the SUM statement. |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
why not append the 01 (are you sure you can only have 99 dups?)
during INREC?
you essentially hae 3 stages to sort (please, kolusu and Frank, don't beat on me for this)
INREC/INFILE where you can do all kinds of things to records
the "sort" part where the output of INREC/INFILE is 'sorted,summed, etc'
the OUTREC/OUTFILE part where the output of the 'sort' part is available for manipulation prior to being written to the output dataset(s). |
|
| Back to top |
|
 |
umanaga
New User
.jpg)
Joined: 09 Apr 2007 Posts: 33 Location: India
|
|
|
|
Sorry if i have missed to mention,
data is fetched from two files using JOIN, REFORMAT, OUTFIL BUILD
After OUTFIL when using SUM fields facing abend. |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
| Bill Woodger wrote: |
| Deja vu |
i, personnally, thought: FM, not again.
umanaga,
since DFSORT forum is a 'do it for you' forum and not a 'here is a hint' forum,
suggest you provide us with all of your control cards,
so that someone can repair them for you. |
|
| Back to top |
|
 |
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Is this some sort of puzzler?
The only skill you list in your profile is 'discussion', yet you fail to provide any useful information.
Why don't you show what you have done so far?
The JCL AND the abend.
This would make it much easier to help you. |
|
| Back to top |
|
 |
umanaga
New User
.jpg)
Joined: 09 Apr 2007 Posts: 33 Location: India
|
|
|
|
Here it is
| Code: |
JOINKEYS FILE=F1,FIELDS=(12,12,A)
JOINKEYS FILE=F2,FIELDS=(12,12,A)
REFORMAT FIELDS=(F1:4,8,3,1,12,2,F2:44,2,56,4,F1:211,2,40,16,56,16)
OUTREC FIELDS=(01:1,9,
10:C'xxxxxxxxxx',
20:10,2,13X,
35:12,2,13X,
50:14,4,11X,
65:18,2,13X,
80:165X,
245:C'000000001',
254:20,16,
270:36,16,
286:208X)
SORT FIELDS=(20,60,CH,A)
SUM FIELDS=(245,09,ZD,254,16,ZD,270,16,ZD) |
|
|
| Back to top |
|
 |
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
What about an input data sample and the ABEND you say you are receiving?
A better english description of the requirement would be nice as well. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Find the FIgure in the DFSORT manual which tells you the order in which things are processed. Compare closely to what you have coded.
Read through what has already been said.
Fix. Try again. Let us know. If it fails, post the sysout as well.
Plus, someone Coded your post for you. Don't let that happen again, but put it in the Code tags yourself. Click on the Quote button, search the forum, look up to the FAQ towards the top of each screen, etc. |
|
| Back to top |
|
 |
umanaga
New User
.jpg)
Joined: 09 Apr 2007 Posts: 33 Location: India
|
|
|
|
prodiving sample input file is difficult due to file length..that is why i have given requirement and data samples my own
Abend faced when above card run is U0027
Myself kept the coding tags, after realizing its not good when viewed the post again. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You need to post the complete sysout including the message ids.
Do not post what you believe we might find useful - post all of the messages from the step. Providing the info a bit at a time only wastes everyone's time - your and ours. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Well done with the Codeing then.
You've had an hour. Have you changed the OUTREC, which operates AFTER SORT/SUM, to INREC? |
|
| Back to top |
|
 |
umanaga
New User
.jpg)
Joined: 09 Apr 2007 Posts: 33 Location: India
|
|
|
|
exactly..i tried changing the OUTREC to INREC after reading complete thread as suggested by you guys.
Thanks. |
|
| Back to top |
|
 |
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
umanaga,
Not sure what you are trying to do here if this is your sort card as of now and IF it produced sample input as you have shown, using OUTFIL SECTIONS,NODETAIL, with COUNT, will get desired results....
Read about SECTIONS here OR provide sample input records.
something like below,..obviously untested.... Check OUTFIL closely...
| Code: |
JOINKEYS FILE=F1,FIELDS=(12,12,A)
JOINKEYS FILE=F2,FIELDS=(12,12,A)
REFORMAT FIELDS=(F1:4,8,3,1,12,2,F2:44,2,56,4,F1:211,2,40,16,56,16)
OUTREC FIELDS=(01:1,9,
10:C'xxxxxxxxxx',
20:10,2,13X,
35:12,2,13X,
50:14,4,11X,
65:18,2,13X,
80:165X,
245:C'000000001',
254:20,16,
270:36,16,
286:208X)
SORT FIELDS=(20,60,CH,A)
SUM FIELDS=(245,09,ZD,254,16,ZD,270,16,ZD)
OUTFIL REMOVECC,NODETAIL,SECTIONS=(CONTROL-BREAK FIELD,
TRAILER3=(FIELDS THAT YOU WANT,COUNT=(EDIT=(ITTTTTTT))))
|
Thanks, |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
| umanaga wrote: |
exactly..i tried changing the OUTREC to INREC after reading complete thread as suggested by you guys.
Thanks. |
Umanaga,
Take a look at the flowchart given here and you will understand how DFSORT process the statements
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA30/1.5.4?
You are better off reformatting the record after you are done with the sorting and summing. By increasing the length of the record before sorting , you are increasing the number of bytes to be sorted. You really don't need to do as you are only padding with spaces.
Your REFORMAT record is creating a 51 byte record and you are expanding it to 493 bytes. So add the counter at byte 52 and perform the SUM. Once you are done with SUMMING you can use OUTREC to expand the record. When you use Positions to BUILD you don't have to specify the (13x,11x,13x...) as by default they will be padded with spaces.
Here are the updated control cards for your job.
| Code: |
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(12,12,A)
JOINKEYS FILE=F2,FIELDS=(12,12,A)
REFORMAT FIELDS=(F1:4,8,3,1,12,2,F2:44,2,56,4,F1:211,2,40,16,56,16)
INREC OVERLAY=(52:C'000000001')
SORT FIELDS=(10,10,CH,A)
SUM FIELDS=(20,16,ZD,36,16,ZD,52,9,ZD)
OUTREC BUILD=(001,09,
010:C'XXXXXXXXXX',
020:10,02,
035:12,02,
050:14,04,
065:18,02,
245:52,09,
254:20,16,
270:36,16,
493:X)
//* |
Sqlcode1,
Did you Forget to remove the SUM FIELDS statement in your job? You would get an error as you are using OUTREC instead of INREC. |
|
| Back to top |
|
 |
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
Skolusu,
I was just trying to explain OP (using the same card that he had originally provided) that he could use OUTFIL SECTIONS to produce the count without having to increase length by overlaying 0s and 1s.
Just another approach, nothing else.
Thanks, |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|