Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.
Moderators: chulett , rschirm , roy
srini.dw
Premium Member
Posts: 186 Joined: Fri Aug 18, 2006 1:59 am
Location: Chennai
Post
by srini.dw » Fri Feb 21, 2014 5:13 am
Hi Guys,
Need 1 help to generate a blank line in the output file at end.
Job desgin
Code: Select all
External_source_1
External_source_2 -> Funnel -> Sequential Stage
Row_Generator
Iam getting the output, the only issue is need a blank line in the output file at the end.
Any help would be appreciated.
Thanks,
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Fri Feb 21, 2014 5:17 am
Use an after-job subroutine ExecSH or ExecSHSilent to execute the command
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
anbu
Premium Member
Posts: 596 Joined: Sat Feb 18, 2006 2:25 am
Location: india
Post
by anbu » Fri Feb 21, 2014 5:23 am
Add this command to filter option in target sequential file
Code: Select all
awk ' { print } END { print "" } '
You are the creator of your destiny - Swami Vivekananda
srini.dw
Premium Member
Posts: 186 Joined: Fri Aug 18, 2006 1:59 am
Location: Chennai
Post
by srini.dw » Fri Feb 21, 2014 5:28 am
Thanks for the replies.
@Ray Before and after job commands are not in the company standards.
@Anbu, i will try this option now.
Thanks,
srini.dw
Premium Member
Posts: 186 Joined: Fri Aug 18, 2006 1:59 am
Location: Chennai
Post
by srini.dw » Fri Feb 21, 2014 5:39 am
Hi, Have tried the option of awk
Without the awk command, iam getting the below output.
Code: Select all
Job_No;65
# 1 blank line
Sequence[1;2]
Job_no;1
With the awk command, iam getting the below output.
Code: Select all
Job_No;65
# 1 blank line
# 2nd blank line is coming
Sequence[1;2]
Job_no;1
#Blank line is coming
How to remove the 2nd blank lines, any ideas.
Thanks,
anbu
Premium Member
Posts: 596 Joined: Sat Feb 18, 2006 2:25 am
Location: india
Post
by anbu » Fri Feb 21, 2014 5:44 am
Awk command prints only one blank line at the end of your output. Verify whether your input stage is generating extra blank lines
Code: Select all
$ echo "Job_No;65
>
> Sequence[1;2]
> Job_no;1 " | awk ' { print } END { print "" } '
Job_No;65
Sequence[1;2]
Job_no;1
$
You are the creator of your destiny - Swami Vivekananda
srini.dw
Premium Member
Posts: 186 Joined: Fri Aug 18, 2006 1:59 am
Location: Chennai
Post
by srini.dw » Fri Feb 21, 2014 5:56 am
The awk command is working fine, will check the extra spaces, Thank you.
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Fri Feb 21, 2014 8:30 am
srini.dw wrote: Before and after job commands are not in the company standards.
I love nonsensical standards.
-craig
"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Fri Feb 21, 2014 2:14 pm
How/where are you executing awk, if not as an after-job command?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Fri Feb 21, 2014 2:18 pm
anbu wrote: Add this awk command to filter option in target sequential file
-craig
"You can never have too many knives" -- Logan Nine Fingers
ssnegi
Participant
Posts: 138 Joined: Thu Nov 15, 2007 4:17 am
Location: Sydney, Australia
Post
by ssnegi » Sun Feb 23, 2014 7:03 pm
You can do this in datastage also.
Add a row generator (No of Records = 1) with char columns with similar names as input and an additional column DUMMY char(1). Set null values '' for all the columns.
Add the DUMMY column char(1) to input also and put 1 in transformer.
Then funnel both these links. Use Sequence funnel with the link ordering set to 1 for the link from the row generator. The row from the input records should be 0.
sequential file properties :
format tab - null field value :null
Partioning tab : DUMMY column SortMerge "Perform sort" ticked Descending with nulls last.
This way the empty row from the row generator would be the last row processed.
srini.dw
Premium Member
Posts: 186 Joined: Fri Aug 18, 2006 1:59 am
Location: Chennai
Post
by srini.dw » Mon Feb 24, 2014 1:21 am
Thanks guys for the replies..