<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16608" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=247380616-05032008><FONT face=Arial size=2>Hello all, I need 
some help with making my screen work the way I want it too.</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial size=2>I have a table 
(simplified version):</FONT></SPAN><SPAN class=247380616-05032008><FONT 
face=Arial size=2></FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier size=2>RECORD 
Users</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier size=2>&nbsp; UserId 
CHARACTER * 8, &amp;</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier size=2>&nbsp; UserName 
CHARACTER * 40</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial size=2>On a screen the User 
can select to view the data in&nbsp;UserId&nbsp;or UserName order by means of a 
function key (toggle switch).</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial size=2>I use a variable 
(not actual syntax)</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier size=2>Element T-Option 
CHARACTER * 1 </FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier size=2>&nbsp; Values "C" 
CAPTION "Code" </FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "D" CAPTION 
"Description"</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial size=2>In my screen I 
created a cursor to handle the orderby but I have no idea if I can "override" a 
field size in the statement.</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial size=2>See below, SortField 
needs to be the same size (character * 40) for the Cursor to work but I can't 
get the syntax to work.</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial size=2>Maybe this needs a 
declare clause embedded...not sure</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier size=2>@if ORACLE<BR>SQL 
IN MYDB &amp;<BR>&nbsp;&nbsp; DECLARE UsersCursor CURSOR FOR 
&amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp; SELECT Users.UserId, 
&amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Users.UserName, 
&amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<FONT color=#ff0000>Users.UserName AS SortField&nbsp; 
&amp;<BR></FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FROM Users 
&amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHERE 'D' = :T-Option 
&amp;<BR>&nbsp;&nbsp;&nbsp; UNION ALL &amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp; SELECT 
Users.UserId, 
&amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Users.UserName, 
&amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<FONT color=#ff0000>Users.UserId AS SortField&nbsp; 
&amp;<BR></FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FROM Users 
&amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHERE 'C' = :T-Option 
&amp;<BR>&nbsp;&nbsp; ORDER BY SortField</FONT></SPAN></DIV>
<DIV><FONT face=Courier size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier size=2>CURSOR UsersCursor 
PRIMARY &amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ALIAS Users 
&amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OCCURS 17<BR>@else<BR>FILE Users 
PRIMARY &amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp; OCCURS 17<BR>&nbsp; ACCESS VIA UserId 
&amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
SEQUENTIAL<BR>@endif<BR></FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier size=2>Any help would be 
appreciated.</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier 
size=2>Ken</DIV></FONT></SPAN>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV></BODY></HTML>