Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Dividing by different factors in outrec (Syncsort)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
Jay Villaverde

New User


Joined: 08 Mar 2014
Posts: 27
Location: USA

PostPosted: Thu Jun 26, 2014 6:49 am    Post subject: Dividing by different factors in outrec (Syncsort)
Reply with quote

Hi. One step in my program is where I want to divide by a certain factor based on a different field.

For example, my data looks like:

Code:

1331658001|00030835|
1331665001|00031028|
1374639001|00029011|
1378471004|00028856|
1463482001|00031032|
1463484001|00031211|
1741893001|00034740|
1741897001|00052321|


I know I can use the following to divide by a set number such as:

Code:

SORT FIELDS=(01,10,CH,A)
OUTREC FIELDS=(01:01,10,                           
                          11:C'|',                             
                          12:12,08,ZD,DIV,+5,EDIT=('TTTTTTTT'),
                          20:C'|')                             



But I have a need to divide some of those numbers in the 2nd column by 5, others by 3, others by 2, etc. based on the number in the 1st column.

Thanks,
Jay
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Jun 26, 2014 12:25 pm    Post subject: Reply to: Dividing by different factors in outrec (Syncsort)
Reply with quote

Why use OUTREC FIELDS instead of OUTREC BUILD? You can see that FIELDS means different things in different contexts, but BUILD does not, so is clearer (processing is identical).

Why use the column numbers when your output data are contiguous?

IFTHEN=(WHEN=(logical-expression) seems to be what you want, unless you can point out why.
Back to top
View user's profile Send private message
Jay Villaverde

New User


Joined: 08 Mar 2014
Posts: 27
Location: USA

PostPosted: Thu Jun 26, 2014 5:11 pm    Post subject:
Reply with quote

Not familiar with IFTHEN but that does seem to be what I need. Can you help with the code for my situation? I'll also look up the usage of it.

Thanks
Back to top
View user's profile Send private message
Jay Villaverde

New User


Joined: 08 Mar 2014
Posts: 27
Location: USA

PostPosted: Thu Jun 26, 2014 5:38 pm    Post subject:
Reply with quote

Looks like I got what I needed. Looked up usage of IFTHEN= and it worked beautifully.

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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us