How to Capture File Name from Sequential File Stage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

poorna_76
Charter Member
Charter Member
Posts: 190
Joined: Thu Jul 08, 2004 10:42 am

Post by poorna_76 »

kduke wrote:

Code: Select all

select 
   EVAL DS_JOBOBJECTS."@RECORD<6>" AS FILE_NAME FMT '45L',
   DS_JOBS.NAME AS JOB_NAME FMT '35L', 
   DS_JOBOBJECTS.NAME AS LINK_NAME FMT '35L'
from 
   DS_JOBOBJECTS, 
   DS_JOBS
where 
   DS_JOBOBJECTS.OLETYPE in ('CSeqOutput','CSeqInput') 
   and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO 
group by 
   FILE_NAME, 
   JOB_NAME,
   LINK_NAME
;
Hi Duke,

Sorry for posting in the same thread.


When i execute a command/ run a query (the above query you posted) through DataStage Administrator, how can i capture the Output to a file/printer?


Thanks in Advance.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

You have to make the SQL all one line if you do it this way. The results can be copied with normal Windows cut and paste commands.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Don't forget the magic words! "PTERM CASE NOINVERT" :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
poorna_76
Charter Member
Charter Member
Posts: 190
Joined: Thu Jul 08, 2004 10:42 am

Post by poorna_76 »

kduke wrote:You have to make the SQL all one line if you do it this way. The results can be copied with normal Windows cut and paste commands.
Hi Duke,

Let me tell you what i am doing?

In DataStage Administrator, selecting the appropriate Project and clicking on "Command" button.
At the Command prompt , i am executing the above query in single line and the results are displayed in CommandOutput.

When the results are displayed in CommandOutput,
it does not allow me either to select the results/ do any Windows cut & paste. (This is happening for anything i execute at the Command prompt in DataStage Administrator)

Thanks in Advance
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

You have to use the TCL prompt in a telnet session. You need to change to the DS engine directory. Enter ". ./dsenv" to put the environment file into your environment. Then, either "bin/uvsh" or "bin/dssh" depending on your version. You're now in the engine shema. Type "LOGTO yourproject" case sensitive. Now you can enter project (schema) commands like Kim has provided.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
poorna_76
Charter Member
Charter Member
Posts: 190
Joined: Thu Jul 08, 2004 10:42 am

Post by poorna_76 »

kcbland wrote:You have to use the TCL prompt in a telnet session. You need to change to the DS engine directory. Enter ". ./dsenv" to put the environment file into your environment. Then, either "bin/uvsh" or "bin/dssh" depending on your version. You're now in the engine shema. Type "LOGTO yourproject" case sensitive. Now you can enter project (schema) commands like Kim has provided.
Thanks, Kenneth Bland.

I am on Windows environment running DataStage 7.5.1A.

Can you please tell me, clear steps on how to execute these queries using the TCL prompt. (on Windows environment)

I tried the following and was unsuccessful:
********
open ServerName

Welcome to DataStage Telnet Server.
Enter user name:
Enter password:

When i entered username & password (correct) i got following messages:

Unable to attach to the given directory.

DataStage telnet session terminating...

Connection to host lost.

************


Do i have to be an Administrator, to run these queries?

Thanks in Advance.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Your home directory must be a DataStage project, or your startup script must attach you to a project directory.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chucksmith
Premium Member
Premium Member
Posts: 385
Joined: Wed Jun 16, 2004 12:43 pm
Location: Virginia, USA
Contact:

Post by chucksmith »

Take a look at my List all files and tables used by jobs in a dsx file tool.

You will find it on the DataStage Tools page of www.anotheritco.com.
Post Reply