Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 
Sum field as Char field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sum field as Char field
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    Post subject: Reply to: Sum field as Char field
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: 2150
Location: At my coffee table

PostPosted: Tue Apr 08, 2008 6:55 pm    Post subject:
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 Moderator


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

PostPosted: Tue Apr 08, 2008 10:32 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Tue Apr 08, 2008 10:38 pm    Post subject:
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    Post subject: Reply to: Sum field as Char field
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    Post subject: Reply to: Sum field as Char field
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    Post subject: Reply to: Sum field as Char field
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 Moderator


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

PostPosted: Wed Apr 09, 2008 9:14 pm    Post subject:
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    Post subject: Reply to: Sum field as Char field
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Select numeric portion from CHAR data... balaji81_k DB2 5 Sat Aug 19, 2017 1:51 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us