Page 1 of 1

understanding Rountine

Posted: Wed Jul 29, 2009 4:41 am
by karthi_gana
All,

What this below routine will do?
what is the purppose of this routine?

RoutineName: InputFileList
Argument Name: FileName

*Ans = ""
DFILE = TRIM(FileName)
OPENSEQ DFILE TO F.DFILE THEN
READSEQ REC FROM F.DFILE ELSE NULL
Ans1 = REC
Ans = 0
RETURN(Ans1)
END ELSE
* Could not open the file. It may not exist. Return empty string
END

i saw this routine is being used in a sequencer job.

in the value expression,

FileDirectory : AsOfDate : ".df_excp.lst"

what it means?

Posted: Wed Jul 29, 2009 4:57 am
by ArndW
The routine will read the first line of the file specified in "FileName" and return that string.

Posted: Wed Jul 29, 2009 8:24 am
by karthi_gana
ArndW wrote:The routine will read the first line of the file specified in "FileName" and return that string. ...
I have files like

df_excp1.log
df_excp2.log
df_excp3.log

i want to get these file names. I used like

"df_excp*.log" in the value expression.

will it work out?

Posted: Wed Jul 29, 2009 9:19 am
by chulett
No. The routine reads a single file.

Posted: Thu Jul 30, 2009 3:19 am
by karthi_gana
chulett wrote:No. The routine reads a single file. ...
then How to achieve my requirement?

Posted: Thu Jul 30, 2009 3:25 am
by ArndW
You should write a loop in a job sequence to expand that wildcard and call the routine within the loop.

Posted: Thu Jul 30, 2009 4:40 am
by karthi_gana
ArndW wrote:You should write a loop in a job sequence to expand that wildcard and call the routine within the loop. ...
Arul, can you help me to write this loop ?

Posted: Thu Jul 30, 2009 4:49 am
by Sainath.Srinivasan
karthi_gana wrote:
ArndW wrote:You should write a loop in a job sequence to expand that wildcard and call the routine within the loop. ...
Arul, can you help me to write this loop ?
Where did Arul come from?

You need an executeCommand stage to get list of files in the pattern. Also loop stages to control the flow.

Try it and ask when you hit any problem.

Posted: Thu Jul 30, 2009 5:24 am
by chulett
What else do you need to do? There must be more than just calling this routine X times. :?

Either build a looping Sequence job as noted or create a new routine that can do whatever with multiple files.

Posted: Fri Jul 31, 2009 5:48 am
by karthi_gana
chulett wrote:What else do you need to do? There must be more than just calling this routine X times. :?

Either build a looping Sequence job as noted or create a new routine that can do whatever with mu ...

I am not getting you....

Posted: Fri Jul 31, 2009 5:56 am
by ArndW
Karthik,

could you explain for us at a high level what you want to do; perhaps there is a better approach to use. I, for one, don't understand your wishes and therefore gave up on adding to the thread. You have a routine that processes one file and returns one value. Then you asked about multiple files - but with no idea of what you are trying to achieve there is nobody here who can assist.