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
 
To shift position of decimal point based on conditions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Vidhya Kalyanasundaram

New User


Joined: 19 Jul 2007
Posts: 30
Location: chennai

PostPosted: Fri Oct 02, 2009 3:16 pm    Post subject: To shift position of decimal point based on conditions
Reply with quote

Hi,

I have a requirement where the position of the decimal point need to vary depending upon the input amount calculated.

Using the EDIT clause, we can only specify a format that would be same throughout the file for all records as given in the below sort card.

OUTREC BUILD=(65:65,16,ZD,EDIT=(SIIIIIIIIT.TTTTTT),
SIGNS=(,-))

But depending on the o/p, Is there any option to vary the formatting fields?

I have attached below a sample o/p expected according to my requirement.

Code:

----7----+----8-
   101000.000000
-100500000.00000
-100500000.00000
   -15000.000000
   -15000.000000
   -15000.000000
   132000.000000
   132000.000000
   132000.000000


Vidhya
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 Oct 02, 2009 9:36 pm    Post subject:
Reply with quote

You can use DFSORT's IFTHEN clauses to reformat different records in different ways.

It's not clear what "rules" you want to use to reformat your records one way or the other so I can't give you specifics, but the basic IFTHEN clause syntax would be something like this:

Code:

   OUTREC IFTHEN=(WHEN=(condition),BUILD=(items)),
      IFTHEN=(WHEN=NONE,BUILD=(items))


For more information on DFSORT's IFTHEN clauses, see:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000088
Back to top
View user's profile Send private message
Vidhya Kalyanasundaram

New User


Joined: 19 Jul 2007
Posts: 30
Location: chennai

PostPosted: Mon Oct 05, 2009 10:00 am    Post subject: Done with the sort card !
Reply with quote

Frank,

Thank you. I was able to solve the issue with the below IFTHEN-WHEN condition, in the sort card.

Code:

OUTREC IFTHEN=(WHEN=(45,13,SFF,GE,+999999999.99),
      OVERLAY=(45:45,13,ZD,EDIT=(IIIIIIIIIT.TT), 
              SIGNS=(,-),                         
              58:58,16,ZD,EDIT=(IIIIIIIIIIIIT.TT),
              SIGNS=(,-))),                       
       IFTHEN=(WHEN=(45,13,SFF,LT,+999999999.99),
      OVERLAY=(45:45,13,ZD,EDIT=(SIIIIIIIIT.TT), 
              SIGNS=(,-),                         
              58:58,16,ZD,EDIT=(SIIIIIIIIIIIT.TT),
              SIGNS=(,-)))                       


Thanks.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Oct 05, 2009 10:07 am    Post subject:
Reply with quote

Hi Vidhya,
As Frank has suggested... for second ifthen no need to check the value of field, you can use WHEN=NONE

Code:

OUTREC IFTHEN=(WHEN=(45,13,SFF,GE,+999999999.99),
      OVERLAY=(45:45,13,ZD,EDIT=(IIIIIIIIIT.TT), 
              SIGNS=(,-),                         
              58:58,16,ZD,EDIT=(IIIIIIIIIIIIT.TT),
              SIGNS=(,-))),                       
       IFTHEN=(WHEN=NONE,
      OVERLAY=(45:45,13,ZD,EDIT=(SIIIIIIIIT.TT), 
              SIGNS=(,-),                         
              58:58,16,ZD,EDIT=(SIIIIIIIIIIIT.TT),
              SIGNS=(,-)))                       
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm

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