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
 

 

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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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