LIST UV.ACCOUNT
Moderators: chulett, rschirm, roy
LIST UV.ACCOUNT
I would like to use this:
echo `${dshome}/bin/dssh "LIST UV.ACCOUNT ${Projectname}FACR1DEV UNIQUE.PATH FMT '256L' HDR.SU
P COUNT.SUP ID.SUP COL.SUP NOPAGE"`
in a shell script and assign its output to a env variable. In English, I want to manipulate the directory path for a passed Project name.
The output of the above command is this:
^[[?1h^[[2J^[[H /opt/ascential/Ascential/DataStage/Projects/<Projectname>
While I can "appreciate" the lovely formatting of this command, I don't want it.
What can be done, Oh rich and powerful UNIX/DataStage Guroos?
echo `${dshome}/bin/dssh "LIST UV.ACCOUNT ${Projectname}FACR1DEV UNIQUE.PATH FMT '256L' HDR.SU
P COUNT.SUP ID.SUP COL.SUP NOPAGE"`
in a shell script and assign its output to a env variable. In English, I want to manipulate the directory path for a passed Project name.
The output of the above command is this:
^[[?1h^[[2J^[[H /opt/ascential/Ascential/DataStage/Projects/<Projectname>
While I can "appreciate" the lovely formatting of this command, I don't want it.
What can be done, Oh rich and powerful UNIX/DataStage Guroos?
Didn't mean for you to have dead air all day. I tried some options, but couldn't figure out a way to purely output the specific result from the command. Everything involved ksh commands to strip off the excess characters. The only other option would be a DS BASIC program that specifically does what you want and outputs it to either stdout or writes a sequential file of content.
Maybe someone should wakeup Ray.
Maybe someone should wakeup Ray.
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
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
It is adding clear screen to the output. Add:
export TERM=dummy
uvsh "LIST UV.ACCOUNT 'DGI' UNIQUE.PATH FMT \"256L\" HDR.SUP COUNT.SUP ID.SUP CO
L.SUP NOPAGE"
You will need a head and a tail to get the third line. Like:
export TERM=dummy
mypath=`uvsh "LIST UV.ACCOUNT 'DGI' UNIQUE.PATH FMT \"256L\" HDR.SUP COUNT.SUP ID.SUP CO
L.SUP NOPAGE" | head -3 | tail -1`
export TERM=dummy
uvsh "LIST UV.ACCOUNT 'DGI' UNIQUE.PATH FMT \"256L\" HDR.SUP COUNT.SUP ID.SUP CO
L.SUP NOPAGE"
You will need a head and a tail to get the third line. Like:
export TERM=dummy
mypath=`uvsh "LIST UV.ACCOUNT 'DGI' UNIQUE.PATH FMT \"256L\" HDR.SUP COUNT.SUP ID.SUP CO
L.SUP NOPAGE" | head -3 | tail -1`
Mamu Kim
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Prefer SQL to RetrieVe. By default, SQL doesn't generate headers, initial form feeds, and the like.
To execute this from a UNIX shell you must be in a directory in which a pointer to UV.ACCOUNT exists. This happens when DS.TOOLS is used in a project (the pointer is not automatically in the account). Or you could cd to the $DSHOME account. For example:
Anyone running a version earlier than 7.x should replace cd $DSHOME with cd `cat /.dshome` or, if it's earlier than version 5.2, with cd `cat /.uvhome` (note the use of backquotes in this command).
Code: Select all
SELECT UNIQUE.PATH FMT '256L' FROM UV.ACCOUNT WHERE @ID = 'DGI';
Code: Select all
cd $DSHOME && . ./dsenv && bin/uv "SELECT UNIQUE.PATH FMT '256L' FROM UV.ACCOUNT WHERE @ID = 'DGI';" > ~/tempprojpath
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.
We got it with this;
plogpath=`${dshome}/bin/dssh "LIST UV.ACCOUNT <Projectname> UNIQUE.PATH FMT '256L' HDR.SUP COUNT.SUP ID.SUP COL.SUP NOPAGE" | sed -e 's/^[^/]*//' | tr -d "\012"`
The sed eliminates everything but two line feeds. The tr does the rest.
I think I like the head tail better but will stick with what I've got cause it is more mysterious, obsure and difficult to understand ... but it does work.
Thanks for the three solutions. It is very appreciated.
plogpath=`${dshome}/bin/dssh "LIST UV.ACCOUNT <Projectname> UNIQUE.PATH FMT '256L' HDR.SUP COUNT.SUP ID.SUP COL.SUP NOPAGE" | sed -e 's/^[^/]*//' | tr -d "\012"`
The sed eliminates everything but two line feeds. The tr does the rest.
I think I like the head tail better but will stick with what I've got cause it is more mysterious, obsure and difficult to understand ... but it does work.
Thanks for the three solutions. It is very appreciated.
Re: LIST UV.ACCOUNT
You could also just grab the project path via a unix utility included with the DSEngine, i.e:While I can "appreciate" the lovely formatting of this command, I don't want it.
What can be done, Oh rich and powerful UNIX/DataStage Guroos?
Code: Select all
$DSHOME/bin/UVread -f11 $DSHOME/UV.ACCOUNT {PROJECTNAME}
Code: Select all
projPath=`$DSHOME/bin/UVread -f11 ${DSHOME}/UV.ACCOUNT ${PROJECTNAME}`
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: