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
 
How to convert the file from X(12) to S9(13)v9(4) COMP-3 var

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Hariprasad_Pargunan

New User


Joined: 08 Jan 2009
Posts: 20
Location: Chennai

PostPosted: Fri Mar 27, 2009 5:07 pm    Post subject: How to convert the file from X(12) to S9(13)v9(4) COMP-3 var
Reply with quote

Hi,

I have an input file which is 12 bytes long i jus wanted to convert the Character Numeric data (FS) present in those 12 bytes to a S9(13)v9(4) COMP-3 field.

The Input and Output file formats are shown below:-

Input File:-

Code:
       95.67
4444444FF4FF
000000095B67


Output File:-


Code:
000000570
00000960C



Please help me out.
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Mar 27, 2009 8:53 pm    Post subject: Reply to: How to convert the file from X(12) to S9(13)v9(4)
Reply with quote

Hariprasad_Pargunan,

You can use the UFF format to convert it to PD format. If you also have a sign then use SFF instead of UFF

Code:

//SYSIN    DD *                     
  SORT FIELDS=COPY                   
  OUTREC BUILD=(1,12,UFF,PD,LENGTH=9)
/*
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Mar 27, 2009 11:45 pm    Post subject:
Reply with quote

Hello,

Will this add the extra zeros that are not part of the input but are wanted in the output?
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: Sat Mar 28, 2009 1:02 am    Post subject:
Reply with quote

Good catch, Dick. I didn't notice the two extra zeros at the end and apparently neither did Kolusu. That just requires multiplying the value by +100 - here's the modified OUTREC statement:

Code:

  OUTREC BUILD=(1,12,UFF,MUL,+100,TO=PD,LENGTH=9)   
Back to top
View user's profile Send private message
Hariprasad_Pargunan

New User


Joined: 08 Jan 2009
Posts: 20
Location: Chennai

PostPosted: Mon Mar 30, 2009 5:16 pm    Post subject: Reply to: How to convert the file from X(12) to S9(13)v9(4)
Reply with quote

Hi,

I jus tried the SORT card

OUTREC BUILD=(1,12,UFF,MUL,+100,TO=PD,LENGTH=9)

and it worked as expected. but I couldnt understand how its giving the O/P 95.6700.

I thought this will give 9567.00 since the data is multiplied by +100.
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 Mar 30, 2009 9:28 pm    Post subject:
Reply with quote

The result of the DFSORT arithmetic is an integer value. In your case, the result is 956700. It's the S9(13)v9(4) COMP-3 definition that's interpreting that integer as 95.6700.

You can use DFSORT edit masks to format the result any way you want, but you asked for a PD value as a result, not a formatted value.
Back to top
View user's profile Send private message
Hariprasad_Pargunan

New User


Joined: 08 Jan 2009
Posts: 20
Location: Chennai

PostPosted: Tue Mar 31, 2009 2:33 pm    Post subject: Reply to: How to convert the file from X(12) to S9(13)v9(4)
Reply with quote

Hi,

I got it.

Thanks for your valuable time spending on my questions.
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

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