IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sum field as Char field


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jayreddy

New User


Joined: 07 Apr 2008
Posts: 10
Location: Mumbai

PostPosted: Tue Apr 08, 2008 2:50 pm
Reply with quote

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
View user's profile Send private message
jayreddy

New User


Joined: 07 Apr 2008
Posts: 10
Location: Mumbai

PostPosted: Tue Apr 08, 2008 3:44 pm
Reply with quote

The values in BALEDFDM fields are
eg :-00000000000126000
-00000000063654195
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Apr 08, 2008 6:55 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Apr 08, 2008 10:32 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Apr 08, 2008 10:38 pm
Reply with quote

Thanks Frank, SFF is what I meant, but sometimes I just don't see the error of my way.....grin....
Back to top
View user's profile Send private message
jayreddy

New User


Joined: 07 Apr 2008
Posts: 10
Location: Mumbai

PostPosted: Wed Apr 09, 2008 2:22 pm
Reply with quote

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
View user's profile Send private message
jayreddy

New User


Joined: 07 Apr 2008
Posts: 10
Location: Mumbai

PostPosted: Wed Apr 09, 2008 4:55 pm
Reply with quote

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
View user's profile Send private message
jayreddy

New User


Joined: 07 Apr 2008
Posts: 10
Location: Mumbai

PostPosted: Wed Apr 09, 2008 8:07 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Apr 09, 2008 9:14 pm
Reply with quote

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
View user's profile Send private message
jayreddy

New User


Joined: 07 Apr 2008
Posts: 10
Location: Mumbai

PostPosted: Thu Apr 10, 2008 2:53 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
Search our Forums:

Back to Top