Conversion of flat file to Mainframe file | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Conversion of flat file to Mainframe file

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-14-2013
mac4rfree mac4rfree is offline
Registered User
 
Join Date: Sep 2008
Last Activity: 22 August 2014, 12:43 AM EDT
Posts: 281
Thanks: 8
Thanked 0 Times in 0 Posts
Conversion of flat file to Mainframe file

Hi guys,

I have a flat file created by ETL tool.

Now the flat file has 4 columns. 1st column is a Character(17), 2nd Column Character(4), 3rd column is a decimal column and 4th column is also a decimal column.

I have to convert this file into a Mainframe file in the following format.

column1 x(17)
column2 x(4)
column3 S9(comp)
column4 S9(comp-3)

Is it possible to convert a text file to a mainframe (readable) format file in unix.

Cheers!!!!!
Sponsored Links
    #2  
Old 03-14-2013
RudiC RudiC is offline Forum Advisor  
Registered User
 
Join Date: Jul 2012
Last Activity: 23 November 2014, 12:04 PM EST
Location: Aachen, Germany
Posts: 4,687
Thanks: 78
Thanked 1,160 Times in 1,090 Posts
What is (comp) and (comp-3)?
Sponsored Links
    #3  
Old 03-14-2013
mac4rfree mac4rfree is offline
Registered User
 
Join Date: Sep 2008
Last Activity: 22 August 2014, 12:43 AM EDT
Posts: 281
Thanks: 8
Thanked 0 Times in 0 Posts
Sorry my bad.

Its S9(4) comp and S9(4) comp-3
    #4  
Old 03-15-2013
RudiC RudiC is offline Forum Advisor  
Registered User
 
Join Date: Jul 2012
Last Activity: 23 November 2014, 12:04 PM EST
Location: Aachen, Germany
Posts: 4,687
Thanks: 78
Thanked 1,160 Times in 1,090 Posts
Without consistent samples of input and desired output files, it's difficult to guess correctly, but you could try:
Code:
$ awk '{printf "%s%s%4.2f%4.2f", $1, $2, $3, $4}' file

Hopefully your mainframe does not need a char set conversion!
Sponsored Links
    #5  
Old 03-15-2013
hanson44 hanson44 is offline
Registered User
 
Join Date: Mar 2013
Last Activity: 12 May 2013, 11:33 PM EDT
Posts: 858
Thanks: 18
Thanked 180 Times in 177 Posts
Would help to have input and output file examples.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Vb file from UNIX to mainframe poova UNIX for Dummies Questions & Answers 1 01-18-2013 11:27 AM
Searching for Log / Bad file and Reading and writing to a flat file mlpathir Shell Programming and Scripting 3 10-03-2010 07:01 PM
Flat file to csv conversion p1_ben Shell Programming and Scripting 6 03-19-2010 03:14 PM
compare XML/flat file with UNIX file system structure shafi2all Programming 6 08-15-2008 03:15 AM
Flat File Conversion Format Loobian UNIX for Advanced & Expert Users 4 05-02-2006 08:05 AM



All times are GMT -4. The time now is 05:07 AM.