How do I get "CO" variable 01 to 67 in character format?

Post Author: Dennis Hernan
CA Forum: Data Connectivity and SQL
I have 2 databases. "DBA"."RMS_A0_SEGMENT" & "DBA"."RMS_G0_SEGMENT". The A0 segment has a CNTY variable. We create table B from A only to create SELYEAR & CO. SELYEAR is numeric because it is "2007 as". CO is numeric because it is "CNTY as". The values in CNTY are 1 to 67 numeric. How do I get "CO" variable 01 to 67 in character format?
Is this standard SQL or would you call it Crysal SQL format? Select "B"."CNTY", "B"."SR", "B"."SEG", "B"."FED_AID",         "B"."TBK_CODE", "B"."PAVE_CYC", "B"."SURFACE",  "B"."LENGTH",         "B".SELYEAR, "C"."KEY_YEAR", "C"."SEG", "C"."SR", "C"."CNTY", "C"."SLDSTATU", "B"."CO" FROM (SELECT "A"."CNTY", "A"."SR", "A"."SEG", "A"."FED_AID",         "A"."TBK_CODE", "A"."PAVE_CYC", "A"."SURFACE",  "A"."LENGTH",         2007 as SELYEAR, CNTY as CO             FROM   "DBA"."RMS_A0_SEGMENT" "A") "B" LEFT JOIN "DBA"."RMS_G0_SEGMENT"  "C"  ON ("B"."SEG" = "C"."SEG") AND ("B"."SR" = "C"."SR") AND ("B"."CNTY" = "C"."CNTY") AND         ("B".SELYEAR = "C"."KEY_YEAR")

Post Author: Dennis Hernan
CA Forum: Data Connectivity and SQL
Here's a simple example: SELECT "A"."A01_CTY_CDE", "A"."DIST_CODE","A"."CTY_NAME", A01_CTY_CDE AS CO NUMERIC(2) FROM SYSADM.CNTY_DIST_XREF "A" I'm trying to create the CO variable numeric(2) from the A01_CTY_CDE which is character(2). The values in A01_CTY_CDE are 1 to 67 character, I need CO to be numeric to merge with another linked table. "I am using the Add Command In Database Expert". I need 4 variables when this is done in the Command Database, A01_CTY_CDE, DIST_CODE,CTY_NAME all charater from the original database "SYSADM.CNTY_DIST_XREF". Also I'm trying & need your help, to create a variable CO with a numberic format, and the values equal to the A01_CTY_CDE variable. Call If you like, Dennis, 717.787.7293.

Similar Messages

  • How can I get the variable with the value from Thread Run method?

    We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
    How can I get the variable with the value?
    This is sample code:
    public class SampleSynchronisation
         public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run method "+sathr.x);
    // I should get Inside the run method::: But I get only Inside
    class sampleThread extends Thread
         public String x="Inside";
         public void run()
              x+="the run method";
    NB: if i write the variable in to a file I am able to read it from external method. This I dont want to do

    We want to access a variable from the run method of a
    Thread externally in a class or in a method. I presume you mean a member variable of the thread class and not a local variable inside the run() method.
    Even
    though I make the variable as public /public static, I
    could get the value till the end of the run method
    only. After that scope of the variable gets lost
    resulting to null value in the called method/class..
    I find it easier to implement the Runnable interface rather than extending a thread. This allows your class to extend another class (ie if you extend thread you can't extend something else, but if you implement Runnable you have the ability to inherit from something). Here's how I would write it:
    public class SampleSynchronisation
      public static void main(String[] args)
        SampleSynchronisation app = new SampleSynchronisation();
      public SampleSynchronisation()
        MyRunnable runner = new MyRunnable();
        new Thread(runner).start();
        // yield this thread so other thread gets a chance to start
        Thread.yield();
        System.out.println("runner's X = " + runner.getX());
      class MyRunnable implements Runnable
        String X = null;
        // this method called from the controlling thread
        public synchronized String getX()
          return X;
        public void run()
          System.out.println("Inside MyRunnable");
          X = "MyRunnable's data";
      } // end class MyRunnable
    } // end class SampleSynchronisation>
    public class SampleSynchronisation
    public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run
    method "+sathr.x);
    // I should get Inside the run method::: But I get
    only Inside
    class sampleThread extends Thread
    public String x="Inside";
    public void run()
    x+="the run method";
    NB: if i write the variable in to a file I am able to
    read it from external method. This I dont want to do

  • How can I get the variable with the value from Thread's run method

    We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
    How can I get the variable with the value?
    This is sample code:
    public class SampleSynchronisation
         public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run method "+sathr.x);
    /* I should get:
    Inside the run method
    But I get only:
    Inside*/
    class sampleThread extends Thread
         public String x="Inside";
         public void run()
              x+="the run method";
    NB: if i write the variable in to a file I am able to read it from external method. This I dont want to do

    Your main thread continues to run after the sathr thread is completed, consequently the output is done before the sathr thread has modified the string. You need to make the main thread pause, this will allow sathr time to run to the point where it will modify the string and then you can print it out. Another way would be to lock the object using a synchronized block to stop the main thread accessing the string until the sathr has finished with it.

  • How do I get a variable, or object from ABAP STACK.

    Hey Gurus,
    How do I get a variable, or object from ABAP STACK.
    Example: I start my FM. I can see in the ABAP STACK the variable I need. I can see the object; I could use to get my variable. I need to use it in my FM; however I need to reference it in the run time. How do I do that?
    Is there a method I can use for reading ABAP STACK?
    Do I just use command: get reference of u2026?
    Does anyone have an example code?
    Basis version 7
    Thanks in advance
    Martin

    Ah, you mean you want to access a variable from another program in the call stack, yes?  You can do this using field symbols, but please don't try to change a value while doing this, it could really screw things up. 
    this example, is using two programs, where the second is accessing variables of the first program.  Basically just notice that we are using the program name and the variable name when assigning the field symbol.
    report zrich_0006 .
    tables: mara.
    parameters: p_matnr type mara-matnr..
    data: matnr type mara-matnr.
    data: imarc type table of marc with header line.
    matnr = p_matnr.
    select * from marc into table imarc up to 10 rows
                   where matnr = p_matnr.
    perform in in program zrich_0007.
    report zrich_0007 .
    *       FORM in                                                       *
    form in.
      data: field(50).
      data: xmarc type marc.
      field-symbols: <matnr>.
      field-symbols: <imarc> type marc_upl_tt.
    * Assign an individual variable
      field = '(ZRICH_0006)matnr'.
      assign (field) to <matnr>.
    * Assign an internal table
      field = '(ZRICH_0006)IMARC[]'.
      assign (field) to <imarc>.
    * Write out your data
      write <matnr>.
      loop at <imarc> into xmarc.
        write: / xmarc-werks.
      endloop.
    endform.
    Regards,
    Rich Heilman

  • How can i get this variable value into second page IN BSP

    Hi friends
    I have variable wk_matnr value 'ABC' in first page of BSP.
    How can i get this variable value into second page.
    Moosa

    Hi,
    you can define variable (page attribiue) on the second page with the same name. You can realise the Navigation with Button ther started onInputProcesing routine. In onInputProcesing you have to call navigation->set_parameter with attribut name as parameter and then starting the navigation. If you have checked the auto property on the variable on second page and varable have same name, the value of variable should be transported.
    [See this tutorial|http://help.sap.com/saphelp_erp2005/helpdata/DE/1a/c5133a62983c0ae10000000a114084/frameset.htm]
    Best regards
    Bogdan

  • How can i get system variable using java

    Hi,
    I just want to know how can i get system variables using java code.
    for example i want to get the the date for today or i want to get the number of processes that's running.
    Thanks alot

    Hi,
    I just want to know how can i get system variables
    using java code.
    for example i want to get the the date for today or i
    want to get the number of processes that's running.
    Thanks alotSome generic "system variables" are available though Java, usually through the System class.
    Date today = new Date();
    is instantiated with the current date and time.
    Other system values, like environment values, should be passed to java through the command line (-D option) by setting system properties.
    Finally, platform specific values like the number of processes running will have to be written in platform specific code and executed by JNI (java native interface).
    Java is platform or system agnostic. Common system values, like time, are implemented. Hopefully you won't need platform specific values.

  • Can anyone let me know how can i get the ouput from BW in .txt format.

    Can anyone let me know how can i get the ouput from BW in .txt format. See we can get output as Excel(i.e BEX) and manually convert it into txt format. I need a direct or automated way to do the same.no human intervention.
    mail me at [email protected] or post answer in sdn.

    Please do not multiple post across forums..
    how can i save the data in BEX reports in .txt format automatically
    This helps in keeping track of answers and avoids the issue of repeated answers across forums...
    Please close one of the threads as answered and provide the link that you want to follow
    Arun

  • How do i get my contacts which are in CSV format onto my ipad gen 2?

    How do I get my contacts copied from a CSV format on windows onto my contact list on my ipad gen 2 or my icloud?

    Restore the backup

  • How do I get back My Yahoo page in windows format. It suddenly switched to App. Andhate it

    My My Yahoo homepage suddenly switched from windows format to App. I hate it how do I get back the old format?
    Peggy

    If you can access the drive using MacDrive, the path to your user home folder is
    <top level>/Users/<your short user name>/
    I don't know of any way to access that drive, other than connecting it to another Mac.

  • How can I get a variable to be stored in the results?

    My report option is set to 'exclude passed,done,skipped' in order to only store failed results. How do I then get a local or global variable stored with this failed result ie temperature?

    Steve -
    1) There is a sequence option that is off by default called, "Immediately Goto Cleanup on Sequence Failure". If this was on the statement step result would be "closer" to the failure.
    2) If you do want to continue after a failure and not goto cleanup, the statement step could be placed after the expected step that will fail. But you would have to add it to places you need the temperature on failure.
    3) Depending on the type of step you are using, if the Post Expression is available to be customized, you could set the report text on the step that can fail:
    Step.ReportText = ((RunState.SequenceFailed) ? ("Locals.Temperature: " + Str(Locals.Temperature)) : "")
    Scott Richardson (NI)
    Scott Richardson
    National Instruments

  • XSLT for ABAP to XML: how can I get a variable in a literal field

    Hi,
    I have the requirement to provide an xml format (for Intrastat reporting) which contains some dynamic data within "".
    Example (I'll put the variables between && for clarity):
    <?xml version='1.0' encoding='UTF-8'?>
         <DeclarationReport xmlns="http://www.onegate.eu/2010-01-01">
              <Administration>
                   <From declarerType="KBO">0000000097</From>
                   <To>NBB</To>
                   <Domain>SXX</Domain>
              </Administration>
              <Report action="&ACTION&" date="&DATE&" code="&CODE&">
                   <Data close="&CLOSE&" form="&FORM&">
                        <Item>
                             <Dim prop="EXTRF">19</Dim>
                             <Dim prop="EXCNT">NL</Dim>
                             <Dim prop="EXTTA">3</Dim>
                             <Dim prop="EXREG">1</Dim>
                             <Dim prop="EXTGO">73202089</Dim>
                             <Dim prop="EXWEIGHT">101</Dim>
                             <Dim prop="EXUNITS">0</Dim>
                             <Dim prop="EXTXVAL">1098</Dim>
                             <Dim prop="EXTPC">3</Dim>
                             <Dim prop="EXDELTRM">CPT</Dim>
                        </Item>
                        <Item>
                             <Dim prop="EXTRF">19</Dim>
                             <Dim prop="EXCNT">DK</Dim>
                             <Dim prop="EXTTA">3</Dim>
                             <Dim prop="EXREG">1</Dim>
                             <Dim prop="EXTGO">83012000</Dim>
                             <Dim prop="EXWEIGHT">88</Dim>
                             <Dim prop="EXUNITS">0</Dim>
                             <Dim prop="EXTXVAL">73456</Dim>
                             <Dim prop="EXTPC">3</Dim>
                             <Dim prop="EXDELTRM">CPT</Dim>
                        </Item>
                   </Data>
              </Report>
            </DeclarationReport>
    All the other variables I've solved by using this technique: <xsl:value-of select="EXTRF"/> but apparently it's not allowed to do this within "".
    I have an idea that params or variables could be used to fill in those fields but I don't find the right syntax.
    For your info, here's my current transformation program; it works except for those fields
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
      <xsl:output encoding="UTF-8" indent="yes" method="xml" version="1.0"/>
      <xsl:strip-space elements="*"/>
      <xsl:template match="/">
        <DeclarationReport xmlns="http://www.onegate.eu/2010-01-01">
          <Administration>
            <From declarerType="KBO">&KBO&</From>
            <To>NBB</To>
            <Domain>SXX</Domain>
          </Administration>
          <Report Code="&CODE&" Date="&DATE&" action="&ACTION&">
            <Data close="&CLOSE&" form="&FORM&">
              <xsl:apply-templates select="//INTRASTAT/item"/>
            </Data>
          </Report>
        </DeclarationReport>
      </xsl:template>
      <xsl:template match="INTRASTAT/item">
        <Item>
          <Dim prop="EXTRF">
            <xsl:value-of select="EXTRF"/>
          </Dim>
          <Dim prop="EXCNT">
            <xsl:value-of select="EXCNT"/>
          </Dim>
          <Dim prop="EXTTA">
            <xsl:value-of select="EXTTA"/>
          </Dim>
          <Dim prop="EXREG">
            <xsl:value-of select="EXREG"/>
          </Dim>
          <Dim prop="EXTGO">
            <xsl:value-of select="EXTGO"/>
          </Dim>
          <Dim prop="EXWEIGHT">
            <xsl:value-of select="EXWEIGHT"/>
          </Dim>
          <Dim prop="EXUNITS">
            <xsl:value-of select="EXUNITS"/>
          </Dim>
          <Dim prop="EXTXVAL">
            <xsl:value-of select="EXTXVAL"/>
          </Dim>
          <Dim prop="EXTPC">
            <xsl:value-of select="EXTPC"/>
          </Dim>
          <Dim prop="EXDELTRM">
            <xsl:value-of select="EXDELTRM"/>
          </Dim>
        </Item>
      </xsl:template>
    </xsl:transform>
    Can anyone help me out here? How can I fill up these variables?
    Thanks

    If you are searching via the Search Bar on the Navigation Toolbar, this preference can be changed to have searches there open in a Tab.
    Type '''about:config''' in the Address Bar and hit Enter. Then answer "I'll be careful". Type this pref in the Search at the top.
    '''browser.search.openintab''' = double-click to toggle to '''true'''

  • How can i get the variable declared in jsp to a javascript function

    Hello all.
    I'm in a trouble.. i was developing a program in jsp oracle. and in some cases i use java scripts.. here in the HR program module i feel a trouble.
    the code here i'm sending is just a trial one.. the jdbc and all are doing in the jsp page itslef.
    egs.. : there is a table with 4 fields
    Empid Empname Empdetails EmpSal
    and in the table there are 100 records. Emp id is the primary key
    here what my problem starts..
    i want to list all the emp id in the combo box
    for that i used jsp program
    now when i select any one emp id i want to display the
    empname emp details and emp salary in another 3 text boxes
    i have successfully placed all the empid in the combo box
    now what i done is i wrote code in java script.. in onchange() for combo
    now i'm not getting the values
    here i'm sending the code.. below..
    please help me
    <html>
    <head>
    <title>DOLOGIN
    </title>
    </head>
    <%@ page language="java" session="true" import="java.sql.*" %>
    <body>
    <form method="POST" name="form1" action="--WEBBOT-SELF--">
         <!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
    <select size="1" name="D1" onchange =xx() >
    <option> Select One</option>
    <%
    String age[] = new String[20];
    String ph[] = new String[20];
    int i=0;     
    try
         try
         {     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         catch(ClassNotFoundException e)
         {     out.println(e);
              String dbURL = "jdbc:odbc:trial";
              Connection dbCon;
              dbCon = DriverManager.getConnection(dbURL);
              String query = "Select * from table1";
              Statement stmt = dbCon.createStatement();
              ResultSet rs = stmt.executeQuery(query);
              while(rs.next())
              {     String name = rs.getString(1);
                   //out.println(name);
                   %>
                   <option value="<%=name%>"><%=name%></option>
                   <%
                   age= rs.getString(2);
                   ph[i] = rs.getString(3);
                   //out.println(age[i]);
                   //out.println(ph[i]);
                   i++;
         %>
         </select>
         <%
              out.println(age[4]);
              dbCon.close();
              stmt.close();
    catch(SQLException e)
    {     response.sendRedirect("error.html");
    %>
    </form>
    </body>
    </html>
    <SCRIPT LANGUAGE=javascript>
    <!--
    function xx()
    {     //alert("aravind")     
         alert(document.form1.D1.selectedIndex)
         alert(document.form1.D1.value)
         alert(age[document.form1.D1.selectedIndex]) //this is not executing//
    //-->
    </SCRIPT>
    here is the code..
    i want the age to run here
    please help me

    To ensure a custom ordering, sort the files in an album and rename the files with a sequentially numbered filename.
    File > Export > Version/Originals
    Then use "Filename > Sequential"
    or "Filename > Album name with index"

  • How is work "Get Shared Variable List with another computer " ?

    Hi all
    I can't receive the list of Shared Variables from   another computer  .
    From localhost computer I received it.
    Why?
    Regards
    Iskander

    First the stupid questions...
    Are you sure the variables have been deployed on the other computer?
    Are you sure you have the right IP Address?
    Could your IT department be blocking you?
    Could Windows firewall be blocking you?
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How do I get system variable of current process id?

    For example:
    select my_process_id from something.
    to know what's the id of running job itself?

    Use this:
    select sid from v$session
    where audsid=userenv 'sessionid');
    Tom Best

  • How Can I get read and write permission for NTFS formatted external Hard Drive?

    How can I use my external formatted disk on MAC with full permissions?

    Install software such as Paragon NTFS on the computer.
    (63161)

Maybe you are looking for

  • How do I fix error code 1771?

    need help i get this over and over here are the diagnostics Microsoft Windows XP Professional Service Pack 3 (Build 2600) HP Pavilion 061 PS588AA-ABA M7067C iTunes 10.6.3.25 QuickTime 7.7.2 FairPlay 1.14.43 Apple Application Support 2.1.9 iPod Update

  • How to restrict folder access on the basis of an ip address

    I would like to restrict folder or item access on the basis of an ip address or domain address, not only with access rights based on login server, to get the possibility of intranet end internet within the machine and the same instance of 9ias.

  • Why can't i copy and paste from safari into email?

    I am able to select text, copy it, but nothing happens after pasting it to the an email or notes.

  • What's the best program for HS Students to do reports with?

    Hi. I am so confused with all the new programs out there that I just don't see what I need or know what to look at! I have a teenager in High School that is always doing school reports and I need to download a program so that she can save and print o

  • Safari allowing large numbers of cookies

    Safari seems to be allowing a relatively large number of third party cookies, despite the fact that I have it set to not allow them. I just upgraded to mountain lion a few weeks ago and have been using chrome, but when I realized I couldn't use some