View previous topic :: View next topic
|
Author |
Message |
jayreddy
New User
Joined: 07 Apr 2008 Posts: 10 Location: Mumbai
|
|
|
|
Hi
Iam having field BALEDFDM Picx(18)
LRECL = 211 ,FB
Positons of BALEDFDM is 139 ,18
I want to do Sort Sum but the field in SUM field is BALEDFDM.
How can I define the format of this filed in the SUM.
Do I need to change the format of the BALEDFDM filed to ZD OR PD and then do Sort sum.
Some one please suggest me.
Regards
Jay |
|
Back to top |
|
|
jayreddy
New User
Joined: 07 Apr 2008 Posts: 10 Location: Mumbai
|
|
|
|
The values in BALEDFDM fields are
eg :-00000000000126000
-00000000063654195 |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
You might have to reformat the sum field in INREC, possibly with USS (Signed free form numeric) and (maybe) reformat it back in OUTREC....
Have you checked the DFSORT Application Programming Guide? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
CICS guy,
That's SFF, not USS, but you have the right idea.
Jay,
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/211)
//SORTOUT DD DSN=... output file (FB/211)
//SYSIN DD *
INREC OVERLAY=(212:139,18,SFF,TO=ZD,LENGTH=17)
SORT FIELDS=(21,1,CH,A)
SUM FIELDS=(212,17,ZD)
OUTREC IFOUTLEN=211,
IFTHEN=(WHEN=INIT,OVERLAY=(139:212,17,ZD,M26,LENGTH=18))
/*
|
|
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Thanks Frank, SFF is what I meant, but sometimes I just don't see the error of my way.....grin.... |
|
Back to top |
|
|
jayreddy
New User
Joined: 07 Apr 2008 Posts: 10 Location: Mumbai
|
|
|
|
Hi Brother,
Its working GR8,but in the SUM key filed you have mentioned
SUM FIELDS=(212,17,ZD) ,does the system creates this length in the INREC .Could you please let me know regarding this.
Regards
Jay
Hi CICSguy,
Thanks for your suggestions.
Regards
Jay |
|
Back to top |
|
|
jayreddy
New User
Joined: 07 Apr 2008 Posts: 10 Location: Mumbai
|
|
|
|
Hi,
But I could see that its ovelaying zeros in the header record at positins 139 to length 18.
as
Header +00000000000000000
Data Record -00000000261963436
-00000000000008882
Data record starts with 20(1:2)
Header contains the record count at Positons (1:10 ) in the file .
Iam getting the number of records in the header using Sorting.
Please let me know if you need any information.
Regards
Jay |
|
Back to top |
|
|
jayreddy
New User
Joined: 07 Apr 2008 Posts: 10 Location: Mumbai
|
|
|
|
Hi
Able to get the thing as required ,by doing the SUM first and then getting the number of records in the file to the header later.
any way number of records changes as Iam doing SUM.
Regards
Jay |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I can't follow all of your posts. You seem to be just throwing out random information. I gave you a solution that worked based on the input you showed me and what you said you wanted for output. Now you're changing the requirement but it's not clear what the new requirement is.
You seem to have a header record - can it be identified as the header record by something in the record (e.g. 'HDR' in positions 1-3) or can it only be identified as the first record? You mention a count - a count of what? where?
Please start over and show a better example of your input records and what you want for output and explain what you want to do. |
|
Back to top |
|
|
jayreddy
New User
Joined: 07 Apr 2008 Posts: 10 Location: Mumbai
|
|
|
|
Hi
Sorry for all the confusion.
My requirement was.
1) count the number of records written to output file in the prog and write it to header.
2) The header is identified by 10 in 1:2 Positons and data part as 20 in 1:2 Positions.
3) Then I was doing Sort SUM on unique key fields.
4) Here the problem was I was getting 00000 ..on the header part at 139 :18 positons.
Eg:
output file : (139:18)postions
100001 +00000000000000000
201111111 -00000000000000100
For this problem
1) I have removed the count of number of records in the output file coming from the programme.ie removed the header part completely
2) Applying Sort SUM (given by you) on the output file
3) Using Sort utility getting the count of number of records in the output file
4)sorting that file to get the Count of records in the output file as the header
Hope I could able to understand you.
Now the problem is solved.Thanks
Regards
Jay |
|
Back to top |
|
|
|