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
 

 

Stuck in handling overflow !

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 176
Location: Pune, Maharashtra, India

PostPosted: Thu Jul 29, 2010 4:09 pm    Post subject: Stuck in handling overflow !
Reply with quote

I am trying to sum up in the case of overflow also. I referred manual but not getting exact usgae of INREC statement with X'00 etc. to handle overflow..! Please assist me in this to handle overflow....!

//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD *
ONE 12
TWO 23
ONE 28
ONE 30
TWO 78
ONE 10
//SORTOUT DD DSN=xxx.DFSORT.OUTPUT,DISP=SHR
//SYSIN DD *
INREC FIELDS=(1,3,4:X'00')
SORT FIELDS=(1,3,CH,A)
SUM FIELDS=(5,2,ZD)
/*
Back to top
View user's profile Send private message

smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Thu Jul 29, 2010 4:25 pm    Post subject:
Reply with quote

Code:

//SYSIN DD *
  INREC FIELDS=(1,4,c'00',5,2)
  SORT FIELDS=(1,3,CH,A)
  SUM FIELDS=(5,4,ZD)
/*
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 176
Location: Pune, Maharashtra, India

PostPosted: Thu Jul 29, 2010 5:15 pm    Post subject: Reply to: Stuck in handling overflow !
Reply with quote

Thanks joss..
would you please explain how does it work ?
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 176
Location: Pune, Maharashtra, India

PostPosted: Thu Jul 29, 2010 5:40 pm    Post subject: Reply to: Stuck in handling overflow !
Reply with quote

Thanks joss... once again i have understood it properly !

But i didnt get the meaning of C and X !

When should i go for X and when for C ?
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Thu Jul 29, 2010 5:46 pm    Post subject:
Reply with quote

only Z stand for binary zero i.e. hex 00

only X would stand for a space : hex 40

C'<text>' stand for string
X'nn' stand for hex nn (in your case x'00' stands for low values)

if you need to understand it better ,
remove the SUM line and run the code ... u ll understand the editing

go through DFSORT: Getting Started
everything is given in detail hardly takes 2 day to finish off
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Thu Jul 29, 2010 6:32 pm    Post subject:
Reply with quote

since you were using ZD i padded 0 to the left of you number to change the length of you field.

if it was binary (pic comp) you could have used X'00' or Z. it would have looked like

Code:

//SYSIN DD *
  INREC FIELDS=(1,4,2Z,5,2)
  SORT FIELDS=(1,3,CH,A)
  SUM FIELDS=(5,4,BI)
/*


OR

Code:

//SYSIN DD *
  INREC FIELDS=(1,4,x'0000',5,2)
  SORT FIELDS=(1,3,CH,A)
  SUM FIELDS=(5,4,BI)


/*
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: Thu Jul 29, 2010 10:29 pm    Post subject:
Reply with quote

Here's a better way to do this with DFSORT - better because you don't have to know which kind of zeros to pad with - DFSORT figures it out for you:

For ZD value in 5-6:

Code:

   INREC BUILD=(1,4,5,2,ZD,TO=ZD,LENGTH=4)   
   SORT FIELDS=(1,3,CH,A)                     
   SUM FIELDS=(5,4,ZD)                       


For BI value in 5-6:

Code:

   INREC BUILD=(1,4,5,2,ZD,TO=BI,LENGTH=4)   
   SORT FIELDS=(1,3,CH,A)                     
   SUM FIELDS=(5,4,BI)                       
Back to top
View user's profile Send private message
Gabriel Araujo Alves

New User


Joined: 20 Jul 2010
Posts: 38
Location: Brazil

PostPosted: Thu Jul 29, 2010 11:34 pm    Post subject:
Reply with quote

Why when i put this, the second zero doesn't display?

Code:
INREC FIELDS=(1,3,05,02,ZD,M11,LENGTH=04)



look at sysout

Code:
ONE 072
TWO 098
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: Thu Jul 29, 2010 11:52 pm    Post subject:
Reply with quote

M11 adjusts the pattern according to the implicit length of the input field (2 in this case). Specifying LENGTH extends the pattern with blanks on the left. EDIT=(TTTT) would give leading zeros if that's what you want.

I assume you have a SORT and SUM statement but I don't know what they look like. Please show ALL of the control statements you're using. Once I know the statements you're using, I'll be able to explain why you got what you got.
Back to top
View user's profile Send private message
Gabriel Araujo Alves

New User


Joined: 20 Jul 2010
Posts: 38
Location: Brazil

PostPosted: Fri Jul 30, 2010 1:26 am    Post subject:
Reply with quote

Look like i do...

Code:
//STEP1 EXEC PGM=SORT                         
//SYSOUT DD SYSOUT=*                           
//SYSPRINT DD SYSOUT=*                         
//SORTIN DD *                                 
ONE 12                                         
TWO 23                                         
ONE 28                                         
ONE 30                                         
TWO 78                                         
ONE 10                                         
/*                                             
//SORTOUT DD SYSOUT=*                         
//SYSIN DD *                                   
 INREC FIELDS=(1,3,05,02,ZD,M11,LENGTH=04)     
 SORT FIELDS=(1,3,CH,A)                       
 SUM FIELDS=(5,2,ZD)                           
/*                                             
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: Fri Jul 30, 2010 1:54 am    Post subject:
Reply with quote

Your INREC and SORT statements give this result:

Code:

ONE  12     
ONE  10     
ONE  28     
ONE  30     
TWO  78     
TWO  23     


p,2,ZD,M11 gives TT because the input length is 2. LENGTH=4 extends that with 2 blanks on the left to give bbTT.

Your SUM statement is summing on 5,2,ZD instead of 6,2,ZD so you're actually summing ' 1' instead of '12', etc. This gives 07 for ONE and 09 for TWO in positions 5-6, and the 7th position is taken from the first record with each key. So you end up with:

Code:

ONE 072
TWO 098


Not sure what you were trying to do but whatever it is, you didn't do it right.
Back to top
View user's profile Send private message
Gabriel Araujo Alves

New User


Joined: 20 Jul 2010
Posts: 38
Location: Brazil

PostPosted: Fri Jul 30, 2010 4:29 am    Post subject: Reply to: Stuck in handling overflow !
Reply with quote

Really, i forget that inrec reformatted the fields.
thanks...
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 Pool Overflow in Mainframe ADABASE polymathtarun Java & MQSeries 4 Fri Jun 03, 2016 11:57 am
No new posts ON ERROR handling soundarr PL/I & Assembler 2 Wed May 11, 2016 3:37 am
No new posts Exception Handling in Native Stored P... Mariraj DB2 1 Thu Feb 25, 2016 4:08 am
No new posts Job Stuck in Processing amitc23 IBM Tools 3 Wed Feb 25, 2015 3:49 pm
No new posts Handling Rexx Abend trushant.w CLIST & REXX 3 Thu Jan 08, 2015 6:42 pm


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