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
 

 

Doubt reg DFSORT Convert option

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Doubt reg DFSORT Convert option
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: 1439
Location: Bangalore,India

PostPosted: Mon Apr 09, 2007 11:16 am    Post subject:
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    Post subject: Re: Doubt reg DFSORT Convert option
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: 3158
Location: Tucson AZ

PostPosted: Mon Apr 09, 2007 3:06 pm    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Mon Apr 09, 2007 3:34 pm    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Apr 09, 2007 8:45 pm    Post subject:
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    Post subject: Re: Doubt reg DFSORT Convert option
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Apr 09, 2007 11:32 pm    Post subject:
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    Post subject:
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    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 DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


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