Routine hangs
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 28
- Joined: Wed Mar 28, 2007 6:57 am
- Location: Amsterdam
Routine hangs
Hi,
Ive made a simple routine that is supposed to unzip a file the code is:
Call DSExecute('DOS', '7z x ' : Filedir : '\' : ZipFile, Output, ReturnCode)
Ans = Output
But if I test this routine it just hangs :s
Got any idea's ?
Kind regards,
Anthony
Ive made a simple routine that is supposed to unzip a file the code is:
Call DSExecute('DOS', '7z x ' : Filedir : '\' : ZipFile, Output, ReturnCode)
Ans = Output
But if I test this routine it just hangs :s
Got any idea's ?
Kind regards,
Anthony
-
- Premium Member
- Posts: 28
- Joined: Wed Mar 28, 2007 6:57 am
- Location: Amsterdam
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
A useful trick
The NUL file (or /dev/null if you're on UNIX) can deliver an infinite number of "presses of Enter". Try something like the following if default answers are OK.
Code: Select all
Call DSExecute('DOS', '7z x ' : Filedir : '\' : ZipFile : " < .\NUL", Output, ReturnCode)
Ans = Output
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 28
- Joined: Wed Mar 28, 2007 6:57 am
- Location: Amsterdam
Hi,
Thankz a lot
this NUL trick works!!
Speaking about null files, does this also work when u want a directory listing? in AIX i use a flatfile stage and then just put in:
/dev/null for the filename and use ls -l #variable# as a filter to get a record by record listing
this trick does not work on windows ![Sad :(](./images/smilies/icon_sad.gif)
Kind regards,
Anthony
Thankz a lot
![Smile :)](./images/smilies/icon_smile.gif)
Speaking about null files, does this also work when u want a directory listing? in AIX i use a flatfile stage and then just put in:
/dev/null for the filename and use ls -l #variable# as a filter to get a record by record listing
![Smile :)](./images/smilies/icon_smile.gif)
![Sad :(](./images/smilies/icon_sad.gif)
Kind regards,
Anthony
That 'trick' should also work on Windows as long as you use the Windows NUL rather than the UNIX /dev/null equivalent, I would think.
There's also a command line 'manual' out there, probably at the main site but also found here:
http://prudentialscatterbrain.hp.infose ... /index.htm
This is for the command line switches but there's a link back to the main topic. I posted the URL to point out that there is a -y switch which says to "assume yes" to all questions, which should solve your original problem a little more... officially.![Wink :wink:](./images/smilies/icon_wink.gif)
There's also a command line 'manual' out there, probably at the main site but also found here:
http://prudentialscatterbrain.hp.infose ... /index.htm
This is for the command line switches but there's a link back to the main topic. I posted the URL to point out that there is a -y switch which says to "assume yes" to all questions, which should solve your original problem a little more... officially.
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 28
- Joined: Wed Mar 28, 2007 6:57 am
- Location: Amsterdam
Hi Chullet,
Thanks your are right! that switch also works
nice ![Smile :)](./images/smilies/icon_smile.gif)
Ehm and about that \nul file if I use
\null for the filename and dir -b #variable# in the filter of a flatfile stage
I get an error that the \nul file cant be found (thats the whole point right? :p)
Thanks for all your help![Smile :)](./images/smilies/icon_smile.gif)
Kind regards,
Anthony
Thanks your are right! that switch also works
![Smile :)](./images/smilies/icon_smile.gif)
![Smile :)](./images/smilies/icon_smile.gif)
Ehm and about that \nul file if I use
\null for the filename and dir -b #variable# in the filter of a flatfile stage
I get an error that the \nul file cant be found (thats the whole point right? :p)
Thanks for all your help
![Smile :)](./images/smilies/icon_smile.gif)
Kind regards,
Anthony
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Get the pathname right. NUL file is in the folder; therefore the pathname is either NUL alone or .\NUL (the dot means "current folder") - not \NUL which means "the nul file in the root directory of the drive.
And, of course one L not two for Windows.
And, of course one L not two for Windows.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 28
- Joined: Wed Mar 28, 2007 6:57 am
- Location: Amsterdam
-
- Premium Member
- Posts: 28
- Joined: Wed Mar 28, 2007 6:57 am
- Location: Amsterdam
Hi chulett thanks for your help
Unfortunately the flatfilestage keeps asking for an existing file
the NUL file trick doesnt work like in UNIX or AIX based systems so it seems...
I can write a routine that puts the contens of a directory in a file and then read this file but this seems like "cruel" work around?
Kind regards,
Anthony
![Smile :)](./images/smilies/icon_smile.gif)
Unfortunately the flatfilestage keeps asking for an existing file
![Sad :(](./images/smilies/icon_sad.gif)
I can write a routine that puts the contens of a directory in a file and then read this file but this seems like "cruel" work around?
Kind regards,
Anthony