Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


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 !!

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-14-2013
Registered User
 
Join Date: Sep 2008
Posts: 280
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
Location: Aachen, Germany
Posts: 1,908
Thanks: 25
Thanked 439 Times in 424 Posts
What is (comp) and (comp-3)?
Sponsored Links
    #3  
Old 03-14-2013
Registered User
 
Join Date: Sep 2008
Posts: 280
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
Location: Aachen, Germany
Posts: 1,908
Thanks: 25
Thanked 439 Times in 424 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
Registered User
 
Join Date: Mar 2013
Posts: 858
Thanks: 18
Thanked 179 Times in 176 Posts
Would help to have input and output file examples.
Sponsored Links
Reply

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 10:27 AM
Searching for Log / Bad file and Reading and writing to a flat file mlpathir Shell Programming and Scripting 3 10-03-2010 06:01 PM
Flat file to csv conversion p1_ben Shell Programming and Scripting 6 03-19-2010 02:14 PM
compare XML/flat file with UNIX file system structure shafi2all Programming 6 08-15-2008 02:15 AM
Flat File Conversion Format Loobian UNIX for Advanced & Expert Users 4 05-02-2006 07:05 AM



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