Sponsored Content
Top Forums Shell Programming and Scripting Copy UNIX File into a DSN with a specific Format Post 302835565 by AnjanM on Monday 22nd of July 2013 04:11:00 PM
Old 07-22-2013
Hi Corona,

This is what i am using for the script :
Code:
df | awk '/WA**.*WA***.*ZFS/ { print $2 }' | sort >> log.txt
cat log.txt | awk -v var="-" '{printf("%- 50s\t %40s %s\n",$1,$2,var)}' | sed "s/^/      /" | sort >> log1.txt |rm log.txt
cat log1.txt |tr -d '()'|awk 'BEGIN {print "   INPUT(- " } {print $0}' >> log2.txt | rm log1.txt
cat log2.txt | echo "    )" >> log2.txt

The output which i get is in the desired format :-
Code:
INPUT(-
      WA**.P**.**MVS.WA**.**NODE.ZFS                             -
      WA**.P**.**MVS.WA**.**TDNODE.ZFS                         -
      WA**.P**.**MVS.WA**.**TDNODE.MOU***.ZFS             -


Here is the problem which i am facing:-

I am able to copy the file into an MVS dataset however when viewing the Dataset on mainfrmae it says :-
"Data contains invalid (non-display) characters"

So i view the file in Unix using vi and when i do a :set list -
Code:
 INPUT(- $
     WA**.P**.**MVS.WA**.**NODE.ZFS                        ^I      -$
    WA**.P**.**MVS.WA**.**TDNODE.ZFS                     ^I      -$
    WWA**.P**.**MVS.WA**.**TDNODE.MOU***.ZFS      ^I      -$

My question is how to get rid of ^I from the file because i believe that is a special character which MVS is detecting.

---------- Post updated at 04:11 PM ---------- Previous update was at 03:49 PM ----------

Please ignore my last post , a very silly mistake on my part .the ^I is a tab and it was showing since my Awk length had \t in it ,once i removed that it has been fixed now.

Once again thanks Corona for your inputs yesterday

Last edited by Franklin52; 07-23-2013 at 10:37 AM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash copy file contents into an existing file at a specific location

Hi all I need to copy the entire contents of one file into an existing file at a specific location. I know the exact line number where I need to put it. It appears I would use either sed or awk to do this, but I have been unsuccessful so far: File A line 1 line 2 line 3 line 4 ... (6 Replies)
Discussion started by: gshepherd7
6 Replies

2. Shell Programming and Scripting

Assigning a specific format to a specific column in a text file using awk and printf

Hi, I have the following text file: 8 T1mapping_flip02 ok 128 108 30 1 665000-000008-000001.dcm 9 T1mapping_flip05 ok 128 108 30 1 665000-000009-000001.dcm 10 T1mapping_flip10 ok 128 108 30 1 665000-000010-000001.dcm 11 T1mapping_flip15 ok 128 108 30... (2 Replies)
Discussion started by: goodbenito
2 Replies

3. Shell Programming and Scripting

How to copy specific file.txt in specific folder?

hye there... i have a problem to copy file in specific folder that will change the name according to host,time(%m%s) and date(%Y%M%D) example folder name: host_20100531.154101801 this folder name will always change... but i just want to copy the AAA.txt and BBB.txt file.. really need... (17 Replies)
Discussion started by: annetote
17 Replies

4. Shell Programming and Scripting

How to check for file name of specific format using find?

I have to find the specific formatted file is present in the received list in the directory, for which I have written: file_list=`ls -lrt /tmp/vinay/act/files |grep "$cdate"| awk '{print $9}'` while read fileStr do find $file_list $fileStr > /dev/null status=`echo $?` if ; then ... (3 Replies)
Discussion started by: IND123
3 Replies

5. Shell Programming and Scripting

Converting windows format file to unix format using script

Hi, I am having couple of files which i used to copy from windows to Linux, so now in case of text files (CTRL^M) appears at end of line. I know i can convert this windows format file to unix format file by running dos2unix. My requirement here is that i want to do it automatically using a... (5 Replies)
Discussion started by: sarbjit
5 Replies

6. Shell Programming and Scripting

How to copy specific files when you don't know the file name?

I hope this isn't as silly as it sounds from the title of the thread. I have software that outputs files where the name starts with a real number followed by underscore as a prefix to an input file name. These will list in the directory with the file with the smallest real number prefix as the... (5 Replies)
Discussion started by: LMHmedchem
5 Replies

7. UNIX for Dummies Questions & Answers

Quick UNIX command to display specific lines in the middle of a file from/to specific word

This could be a really dummy question. I have a log text file. What unix command to extract line from specific string to another specific string. Is it something similar to?: more +/"string" file_name Thanks (4 Replies)
Discussion started by: aku
4 Replies

8. Shell Programming and Scripting

Copy specific file (different but same name) as folder name

I have to copy a particular file present in a main folder having part of the file-name present in many sub-folders to a new destination preserving the name of the source "part of the main folder" and previous file-name of the output file: Example: From /005_0/1000/005.xxx ->... (7 Replies)
Discussion started by: wappor
7 Replies

9. Shell Programming and Scripting

Find and Copy file of specific location

Dear All, I need to transfer all files present in one location to another but those files should be of specific extension like. Find and copy all files of extension .xls, .pdf, .txt from location usr/tmp to location /per/Treat (6 Replies)
Discussion started by: yadavricky
6 Replies

10. AIX

I cannot find dsn and TNSNAMES.ora on UNIX

Where can I find dsn and TNSNAMES.ora on UNIX AIX Thanks for contribution (3 Replies)
Discussion started by: digioleg54
3 Replies
remote-filesystems(7)					 Miscellaneous Information Manual				     remote-filesystems(7)

NAME
remote-filesystems - event signalling that remote filesystems have been mounted SYNOPSIS
local-filesystems [ENV]... DESCRIPTION
The remote-filesystems event is generated by the mountall(8) daemon after it has mounted all remote filesystems listed in fstab(5). moun- tall(8) emits this event as an informational signal, services and tasks started or stopped by this event will do so in parallel with other activity. This event is typically used by services that must be started to manage remote filesystems. When it occurs, local filesystems such as /usr may not be mounted. For most normal services the filesystem(7) event is sufficient. This event will never occur before the virtual-filesystems(7) event. EXAMPLE
A service that wishes to be running once remote filesystems are mounted might use: start on remote-filesystems SEE ALSO
mounting(7) mounted(7) virtual-filesystems(7) local-filesystems(7) all-swaps(7) filesystem(7) mountall 2009-12-21 remote-filesystems(7)
All times are GMT -4. The time now is 05:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy