Issue in using file path in Routine

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
dxk9
Participant
Posts: 105
Joined: Wed Aug 19, 2009 12:46 am
Location: Chennai, Tamil Nadu

Issue in using file path in Routine

Post by dxk9 »

Hi,

I have a routine which opens a file if it exists else it creates one.

Note: This is only a part of actual routine

Code: Select all

If NOT(Initialized) Then
	* Not initialized. Attempt to open the file.
       Initialized = 1
       Open "EndDateFile" TO StopDateFile Else
	    * Open failed. Create the sequence file.
            EXECUTE "CREATE.FILE EndDateFile"
            Open "EndDateFile" TO StopDateFile Else Ans = -1
       End
    End 
This routine works fine if the file "EndDateFile" is present/created at Account name. But if I define a path in the routine ("/Data/Dev/EndDateFile"), it doesn't work.

I get the error:

Subroutine failed to complete successfully (30107)

Please help me to solve the issue.

Thanks,
dxk9
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Does the path "/Data/Dev/" exist as seen from the DataStage server? I note that you are on windows and while the UNIX type paths are legal, I'm not sure on which drive this would be for...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

CREATE.FILE can not be used with a pathname. The filename argument to CREATE.FILE ends up being a VOC entry.

If you want to create a pathed hashed file then you need to use the operating system command mkdbfile. Note that this command neither creates nor populates the metadata (dictionary) portion. If you want that to happen you have to organise it yourself.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dxk9
Participant
Posts: 105
Joined: Wed Aug 19, 2009 12:46 am
Location: Chennai, Tamil Nadu

Post by dxk9 »

ArndW ,

I am sorry for the confusion, this is a issue with IIS Datastage 8.5 and its installed in unix.

Yes, I am able to view that path via Datastage.

Ray,

I am not able to view your entire reply as I am not a premium member :( Can you please send me again in a format such that non-premium members can view.

Thanks,
dxk9
Post Reply