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

Doubt reg DFSORT Convert option


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

New User


Joined: 23 Aug 2006
Posts: 12
Location: Chennai

PostPosted: Mon Apr 09, 2007 10:59 am
Reply with quote

Hi ,

I having a file where the fields are Comp-3 and comp.

eg:
A pic 9(3)v99 comp-3.
B pic 9(4)v999 comp.

I need to convert the above fields to Display format.

How can i code it using DFSORT Convert option.

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

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Apr 09, 2007 11:16 am
Reply with quote

Use the following -

Code:

  OPTION COPY
  OUTREC FIELDS=(1,3,PD,TO=ZD,LENGTH=5,   * FOR COMP-3
                           4,7,BI,TO=ZD,LENGTH=7)   * FOR COMP
Back to top
View user's profile Send private message
MKP

New User


Joined: 23 Aug 2006
Posts: 12
Location: Chennai

PostPosted: Mon Apr 09, 2007 3:02 pm
Reply with quote

Hi Murali,

My sysin is as below

Code:
//SYSIN    DD  *                                           
  OPTION COPY                                               
  OUTREC FIELDS=(7,6,PD,TO=ZD,LENGTH=11) --> TRUNCATED AMOUNT
/*                                                         


I got an output as
Code:
9?24000000.
9?16000000.

But i need the output as
Code:
240000000.00
160000000.00
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Apr 09, 2007 3:06 pm
Reply with quote

IIRC, convert is used for variable to fixed format conversion.

It would help us all if you would post an example of your input and expected output. Please also include record length and format.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Apr 09, 2007 3:34 pm
Reply with quote

If your file is a VB one, add 4 to the start column.

Also give the number of bytes occupied by the variable and not the size as per declaration.
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: Mon Apr 09, 2007 8:45 pm
Reply with quote

Muthu,

To get an output value like:

240000000.00

You can use a DFSORT edit mask like this:

p,m,f,EDIT=(TTTTTTTTT.TT)

But it's not clear what your input field looks like. You describe a PD and a BI field but then show 7,6,PD. We don't know if the field actually starts in position 7 and if it's really a 6-byte PD field. We also don't know if your RECFM is FB or VB. You need to be more clear about what your input fields look like. Give the starting position, length and format of each field and the RECFM and LRECL of the input file. Show an example of an input record in hex if possible. Show what you want for output.
Back to top
View user's profile Send private message
MKP

New User


Joined: 23 Aug 2006
Posts: 12
Location: Chennai

PostPosted: Mon Apr 09, 2007 9:28 pm
Reply with quote

The quoted statement

//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(7,6,PD,TO=ZD,LENGTH=11) --> TRUNCATED AMOUNT
/*

is the real requirement and my input file is having two values which are in PD format [9(9)v99 comp3] starting position is 7. The input file type is FB and the output file type is FB.

Input file is having the values whose format is 9(9)v99comp3
240000000.00
160000000.00

output file should have the values whse format is 9(9)v99 or 9(9).99
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: Mon Apr 09, 2007 11:32 pm
Reply with quote

Then you can use these DFSORT statements:

Code:

  OPTION COPY
  OUTREC FIELDS=(7,6,PD,EDIT=(TTTTTTTTT.TT))
Back to top
View user's profile Send private message
MKP

New User


Joined: 23 Aug 2006
Posts: 12
Location: Chennai

PostPosted: Tue Apr 10, 2007 9:40 am
Reply with quote

Frank,

Thank you very much the code is working fine.
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 SCOPE PENDING option -check data DB2 2
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top