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

Is it possible to USE DIVIDE in DFSORT


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

New User


Joined: 28 Jun 2007
Posts: 23
Location: Bangalore

PostPosted: Tue Nov 06, 2007 8:57 pm
Reply with quote

Hi All,

Is it possible to USE DIVIDE in DFSORT by any number instead of predefined D,M,C etc.

Please let me know.

Thanks
Anish.
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 Nov 06, 2007 10:12 pm
Reply with quote

You can use DIV (for divide) in BUILD or OVERLAY with DFSORT. For example:

Code:

   INREC BUILD=(11:11,8,ZD,DIV,+20,TO=ZD,LENGTH=8)


If you need more specific help, you'll need to supply more details about what you're trying to do.
Back to top
View user's profile Send private message
anish.ibm

New User


Joined: 28 Jun 2007
Posts: 23
Location: Bangalore

PostPosted: Tue Nov 06, 2007 10:30 pm
Reply with quote

Hi Frank,


Thx for the Info. I have

Code:


ABC:   4523223
A  :   2432300


I need A/ABC and reformatted in this way as below

Code:


ABC:   4523223
A  :   2432300
C  :   0.5377


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

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Nov 06, 2007 10:52 pm
Reply with quote

anish.ibm

Hello anish, is that you have only 2 records in your i/p or more than that?
If so, show example as to how the i/p and o/p looks like?
i/p and o/p RECFM and LRECL?
Back to top
View user's profile Send private message
anish.ibm

New User


Joined: 28 Jun 2007
Posts: 23
Location: Bangalore

PostPosted: Tue Nov 06, 2007 11:06 pm
Reply with quote

Hi Kris,

I have some set of records. But i need only for one set of record . That will do... i will enhance the solution.


Thanks,
Anish.
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 Nov 06, 2007 11:29 pm
Reply with quote

Quote:
I have some set of records. But i need only for one set of record . That will do... i will enhance the solution.


I would suggest a different solution for two records vs "some set of records". Please show an example that more closely matches what you're trying to do so I can offer a solution that will work for what you're actually doing.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Nov 07, 2007 12:01 am
Reply with quote

Quote:
I have some set of records. But i need only for one set of record . That will do... i will enhance the solution.
We would like to provide the enhanced solution,So please provide ample amount of example records that describe the i/p and o/p
Back to top
View user's profile Send private message
anish.ibm

New User


Joined: 28 Jun 2007
Posts: 23
Location: Bangalore

PostPosted: Wed Nov 07, 2007 7:04 pm
Reply with quote

Hi Frank/Kris,

My requirement is below..


Input file

Code:

Header record
23323 21 1232212 (23323/1232212)*100  <-- Need the result of this expression here in this 5 Byte area
21122 35 2122212 (21122/2122212)*100   
..
..
Trailer record


Output file

Code:

Header record
23323 21 1232212 01.89
21122 35 2122212 00.99
..
..
Trailer record



Thanks,
Anish.
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 Nov 07, 2007 10:36 pm
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
Header record
23323 21 1232212
21122 35 2122212
Trailer record
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,6,CH,NE,C'Header',AND,
    1,7,CH,NE,C'Trailer'),
    OVERLAY=(18:(1,5,ZD,MUL,+10000),DIV,10,7,ZD,EDIT=(TT.TT)))
/*
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts DFSORT - VB file RDW getting overridden DFSORT/ICETOOL 3
Search our Forums:

Back to Top