How to create file based on date value
Hi
Hope you'll help me. I can't find right way to tackle the problem. I need to read a file which name is created based on month and years' value. File name format is as follows: INMMYY.log. So to read it I must create File object using this file name format. I tried to use Calendar class get necessary information using get() method. Unfortunatelly returned month's value is always 2,3,4 and so on..(I need 02,03). There is problem with year's value als. It's returned in form YYYY but I need YY.
Does anybody have any idea how to create string INMMYY in the easiest way ??
Thanks in advance :)
Use java.text.SimpleDateFormat.
Similar Messages
-
How to get the most current file based on date and time stamp using SSIS?
Hello,
Let us assume that files get copied in a specific directory. We need to pick up a file and load data. Can you guys let me know how to get the most current file based on date and time stamp using SSIS?
Thanks
thx regards dinesh vvhi simon
i excuted this script it is giving error..
Microsoft SQL Server Integration Services Script Task
Write scripts using Microsoft Visual C# 2008.
The ScriptMain is the entry point class of the script.
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
namespace ST_9a6d985a04b249c2addd766b58fee890.csproj
[System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
#region VSTA generated code
enum ScriptResults
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
#endregion
The execution engine calls this method when the task executes.
To access the object model, use the Dts property. Connections, variables, events,
and logging features are available as members of the Dts property as shown in the following examples.
To reference a variable, call Dts.Variables["MyCaseSensitiveVariableName"].Value;
To post a log entry, call Dts.Log("This is my log text", 999, null);
To fire an event, call Dts.Events.FireInformation(99, "test", "hit the help message", "", 0, true);
To use the connections collection use something like the following:
ConnectionManager cm = Dts.Connections.Add("OLEDB");
cm.ConnectionString = "Data Source=localhost;Initial Catalog=AdventureWorks;Provider=SQLNCLI10;Integrated Security=SSPI;Auto Translate=False;";
Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
To open Help, press F1.
public void Main()
string file = Dts.Variables["User::FolderName"].Value.ToString();
string[] files = System.IO.Directory.GetFiles(Dts.Variables["User::FolderName"].Value.ToString());
System.IO.FileInfo finf;
DateTime currentDate = new DateTime();
string lastFile = string.Empty;
foreach (string f in files)
finf = new System.IO.FileInfo(f);
if (finf.CreationTime >= currentDate)
currentDate = finf.CreationTime;
lastFile = f;
Dts.Variables["User::LastFile"].Value = lastFile;
Dts.TaskResult = (int)ScriptResults.Success;
thx regards dinesh vv -
How to create Formula based value field in COPA
Hi,
I want to know how to create formula based value field in COPA
My Requirement is i want to collect some value in formula based value field and want to use in copa allocation cycle as a tracing
factor.
anybody give some light on the same topic or requirement ?
Thanks
Nilesh RThe key figure you are creating in KE2K is not a value field, i.e. you can't post to it and you can't use it in a report. It is a caluculated value that can be used only in assessment and top-down-distribution.
In Ke2K, enter a name for your key figure, then click on the the white sheet button to create it. Now the formular area is open for input. Input your formular (e.g. VV001 + VV002 - VV003 .... where VVXXX are the technical names of value fields).
Now click the "check formuar"-button. Then save.
Before you can use the key figure in assessment, execute TC KEUG.
Now the key figure is available as any value field in the tracing factor selection of your assessment cycle.
I hope this made it clearer.
Regards
Nikolas -
How to create file on application server?
how to create file on application server?
Hi,
The following program illustrates the creation of ifle in app server and reading the file from appli server:
DATA: ITAB LIKE vbakOCCURS 0 WITH HEADER LINE.
PARAMETERS: P_VBELN LIKE VBAP-VBELN.
START-OF-SELECTION.
SELECT *
FROM VBAP
INTO TABLE ITAB
WHERE VBELN = P_VBELN
PERFORM WRITE_DATA.
PERFORM READ_DATA.
*& Form WRITE_DATA
text
--> p1 text
<-- p2 text
FORM WRITE_DATA.
OPEN DATASET 'VBAP_DATA' FOR OUTPUT IN TEXT MODE.
LOOP AT ITAB.
TRANSFER ITAB TO 'VBAP_DATA'.
ENDLOOP.
CLOSE DATASET 'VBAP_DATA'.
CLEAR: ITAB, ITAB[].
ENDFORM. " WRITE_DATA
*& Form READ_DATA
text
--> p1 text
<-- p2 text
FORM READ_DATA.
OPEN DATASET 'VBAP_DATA' FOR INPUT IN TEXT MODE.
DO.
READ DATASET 'VBAP_DATA' INTO ITAB.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
APPEND ITAB.
ENDDO.
CLOSE DATASET 'VBAP_DATA'.
LOOP AT ITAB.
WRITE:/ ITAB-VBELN,
ITAB-POSNR.
ENDLOOP.
ENDFORM. " READ_DATA
If it is helpful rewards points
Regards
Pratap.M -
hi,
i have below block,
DECLARE
doc dbms_xmldom.DOMDocument;
node dbms_xmldom.DOMNode;
elem dbms_xmldom.DOMElement;
cur_node dbms_xmldom.DOMNode;
root_elem_data dbms_xmldom.DOMElement;
root_elem_tab dbms_xmldom.DOMElement;
root_node_data dbms_xmldom.DOMNode;
mode_elmn dbms_xmldom.DOMElement;
mode_node dbms_xmldom.DOMNode;
mode_text dbms_xmldom.DOMText;
doc1 DBMS_XMLDOM.DOMDOCUMENT;
root_node_data1 DBMS_XMLDOM.DOMNODE;
child_document DBMS_XMLDOM.DOMDOCUMENT;
child_rootnode DBMS_XMLDOM.DOMNODE;
V_CLOB CLOB;
v_doc CLOB;
v_EMP CLOB;
v_output_filename VARCHAR2(300) := 'SPOOL_DIR/'||'EMP_XML_FILE.xml';
l_xmltype XMLTYPE;
BEGIN
doc := dbms_xmldom.newDOMDocument;
node := dbms_xmldom.makeNode(doc);
dbms_xmldom.setversion(doc, '1.0');
dbms_xmldom.setCharset(doc, 'UTF8');
elem := dbms_xmldom.createElement(doc, 'PartnerInfo');
dbms_xmldom.setAttribute(elem,'xmlns','EMP');
cur_node := dbms_xmldom.appendChild(node, dbms_xmldom.makeNode(elem));
mode_elmn := dbms_xmldom.createElement(doc, 'EMPLOYEE');
mode_node := dbms_xmldom.appendChild(cur_node,dbms_xmldom.makeNode(mode_elmn));
BEGIN
SELECT value(e) INTO l_xmltype
FROM TABLE(XMLSequence(Cursor(SELECT * FROM EMP1 where EMPNO=7501))) e;
child_document := DBMS_XMLDOM.newDOMDocument(l_xmltype);
root_node_data1 := dbms_xmldom.importNode(doc,dbms_xmldom.makeNode(dbms_xmldom.getDocumentElement(child_document)),TRUE);
root_node_data1 := DBMS_XMLDOM.appendChild(root_node_data, root_node_data1);
EXCEPTION
WHEN OTHERS THEN
Dbms_Output.Put_Line('Error in SELECT stmt(UC_PARTNER_MS):::'||'error::'||SQLERRM);
END;
dbms_lob.createtemporary(v_doc, true);
dbms_xmldom.writeToClob(doc,v_doc,'UTF8');
v_EMP:= v_doc;
dbms_xmldom.writeToFile(DOC,v_output_filename,'UTF8');
dbms_xmldom.freeDocument(doc);
--Dbms_Output.Put_Line('THE OUTPUT IS::'||V_EMP);
EXCEPTION
WHEN OTHERS THEN
Dbms_Output.Put_Line('Error in SELECT stmt(UC_PARTNER_MS):::'||'error::'||SQLERRM);
END;
The xml file is 'EMP_XML_FILE.xml'
<empno>U++kYmcVuGchxbh+++++++++++++++1+</empno>
<empname>J</empname>
suppose the empno 7501 is not available in our emp table,
i got error
ORA-03113: end-of-file on communication channel
how to handle xmldom with no data values.
by
sivahi,
please give the solution
by
siva -
How to create a variance on data that exists iIn only one database column
How to create a variance on data that exists iIn only one database column?
I'm trying to create a calculation to show the difference between the budgets for two different years in a Discoverer crosstab query.
I'm using the lag function to repeat the value of a column for the current year and the year before.Lag and lead seems to be the only choice and they work excellent. Checkout the new 10g Database features. There is new SQL modal clause which might give additional and powerful analytics but in this case lag and lead should be sufficient.
regards
http://www.infocaptor.com/workbook-dump.php -
How to create a matrix with constant values and multiply it with the output of adc
How to create a matrix with constant values and multiply it with the output of adc
nitinkajay wrote:
How to create a matrix with constant values and multiply it with the output of adc
Place array constant on diagram, drag a double to it, r-click "add dimension". There, a constant 2D double array, a matrix.
/Y
LabVIEW 8.2 - 2014
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
G# - Free award winning reference based OOP for LV -
Hello everybody,
It's my first time using Java Card ^_^,I want to create a file and fill the fill with binary data.but i don't know how to create file with APDU commands,so I need help here.
I think that there must be a Manual of the JavaCard's OS in this world,can someone tell me where to download it??
Thanks.
the fllowing is my card:
Samsung S1
Model:TiEx-32J
EEPROM size:32k
Platform Version:OP 2.0.1
Card Manager Status:OP_READY
KMC:40~4F/No derivation
Message was edited by:
AllenHuangIf you look around the forum for a bit, you will see that there is no notion of file systems on JavaCards (lexdabear posted this information less than two hours ago :-)). To store files, you will have to write an applet to hold byte arrays of the required size and handle receiving and sending of these.
As for documentation, you should have a look at the GP (General Platform) specification at http://www.globalplatform.org/, which defines communication between smart cards and other devices, as well as Sun's own JavaCard pages (http://java.sun.com/products/javacard/), which contain several useful resources on JavaCards.
Message was edited by:
Lillesand -
How to Create Rule in Interface Data Transformer.
Hi,
If any one know how to Create Rule in Interface Data Transformer(IDT) Super user by using Lookup(Oracle R12 Version) Please help me on this.
I have one value in GL Interface table, while loding data into base tables (GL_JE_BATCHES, GL_JE_HEADERS, GL_JE_LINES) that values replace with another value.
For that purpose we have to use Interface Data Transformer.
If any one how to create rule in IDT, Please give me a example how to create rule by using Lookup.
Thanks in Advance.
Regards
Varma.Hi;
Please check below note which could be helpful for your issue:
Setup Checklist for the Interface Data Transformer - Global Consolidations System [ID 277875.1]
Regard
Helios -
How to create Profile Based Rule in Endeca Studio Developer
Hi,
Can anybody tell me how to create Profile based rule in the Endeca Studio Developer. and how to fecth the data in the JSP. what are the parameter required to pass in the ENEQuery
Thanks
ShaileshI use visual studio 2012.
I dont see rule set editor which can help me create busineesss rule.
Where can I find it?
Hi Rajesh,
If you want to learn more information about RuleSet Editor in .net framework 4.5, check out https://msdn.microsoft.com/en-us/library/ee960221(v=vs.110).aspx
for more information.
Best regards,
Angie
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
HOW TO CREATE PROMPT BASED ON ANOTHER PROMPT IN OBIEE
HOW TO CREATE PROMPT BASED ON ANOTHER PROMPT IN OBIEE.
Requiremenst is as follows.
Year ,Qtr columns in first prompt.Based on selection on these prompts second prompt should display corresponding prompts
Second prompt will have Month ,Week and Day columns.Second prompt should be hidden and based on first prompt selection second prompt should display with constraint based on first prompt.
Any help would be highly appriciated!!!hi,
Using Guided navigation it is possible,
Please refer the below links.
http://gerardnico.com/wiki/dat/obiee/dashboard_prompt_1_eq_0
http://businessdecisionsystems.com/blog/?p=448
Hope this help's
Thanks,
Satya -
How to dynamic select based on runtime value ?
how to dynamic select based on runtime value ?
I want to write a select function, which do selecting based on parameters. eg,
CREATE OR REPLACE FUNCTION myfunction
(tableName VARCHAR2, pkName VARCHAR2, pkValue VARCHAR2, requestString VARCHAR2)
RETURN VARCHAR2 AS
BEGIN
select requestString from tableName where pkName=pkValue;
RETURN NULL;
END;
myfunction('users', 'user_id', '100', 'user_name'); it will select 'user_name' from table 'users' where 'user_id' = '100'.
This way could save lots of coding. but it can't pass compiler. how to work out ?
Thanks.While this may save code, if used frequently it will be ineffecient as all [explicative deleted]. The danger is that it would be used even for repeatable statements.
This mode of operation ensures that every statement [calling the funciton] needs to be reparsed, which is extremely expensive in Oracle (in CPU cycles, recursive SQL and shared pool memory).
Such reparsing is rarely a good thing for the environment ... it could easily lead to buying more CPU (bigger box) and therefore adding more Oracle license ... which could quickly exceed the typical developer's salary.
However - if you really, really want to do this, look up 'execute immendiate' in the PL/SQL manuals. -
How to avoid the Amount and Date values for VOID Cheques
Hi All,
I had created a two window i.e For Amount and Date. If I process the cheque the Amount value and Date should not trigger for VOID CHEQUES.
Can any one tel me how to avoid the Amount and Date values for VOID Cheques
Your help will be greatly appreciated.
Regards
YathishHi,
I dont know which tablel you are referring to, is it PAYR table and the field VOIDR?
If a cheque is voided, it would have a reason and it is stored in VOIDR field of this PAYR table.
Check if the field VOIDR is filled, if it is filled, do not print the amount and date.
Regards
Subramanian -
Hide Repeating Frames based on data value
Hello,
Wonderful forum. Hope someone out there can give us input on this one. We have a report where we would like to show a different layout depending on the data value from the master query. One layout occupies a full 8X11 page and the second layout occupies 1/3rd of a page. Is it possible to hide one reapeating frame and show the other based on data value? This would be a multiple page report and each page will have to take the correct payout depending on the value of the data in the row.
I appreciate any input on this. Thanks
RaviThanks for you input. I appreciate it.
I am having a problem doing this. Let us say i have 2 differnt paper layouts. I want to show or hide one of the layouts based on a data value.
The problem i am facing is that the 2nd instance of true value for showing the 1st layout is over lapping the 1st instance of the 2nd layout thus showing 2 layouts overlapping each other on the same page. I know this is confusing but i will attempt to give an example:
page 1 shows - layout #1 only is showing based on result of data value. This is good.
page 2 shows - layout #2 shows based on data value, but also the 2nd instace of layout #1 (what ever data record satisfies layout #1 rule) is also showing over layout #2. So both the layouts are jumbled up on 1 page.
Essentially conditional formatting on layout #1 is not able to recognize that there is a 2nd layout taking its place and thus showing the layout #1 whenever it finds data which satisfies the condition on the 2nd page and so on..
Any help is greatly appreciated.
Thanks.. -
How to create file menu in the swing?
How to create file menu or any menu in the swing?
Please help me.How to create file menu or any menu in the
swing?
Please help me.By file menu, do you mean where you can choose a file to open or save to? If so, have you had a look at the File Chooser component? If not, please click on the link in the previous sentence to the Sun tutorial.
Good luck
/Pete
Maybe you are looking for
-
I have posted "submit" twice and keep getting requests to submit again. Now being asked to write a summary! Here we go. I have iPhoto 08 and am happy with it. Don't want to upgrade. But suddenly when I click on an event, instead of getting all the
-
Ok, so I dropped my iPhone last night It was a low drop, about 4 feet, and it only fell on a thick carpeted floor. But it's not working properly now. These are the problems that I'm getting: • the Home button does not respond at all, which means I ca
-
Im just curiious about connecting a ipod to mac and windows
hi guys i have a windows and a mac comp and im just curious if i format (restore) my ipod on my windows will it ALSO read and do everything it should on a mac? thanks guys!
-
Trying to Back up my Windows 7 using Windows "Backup & Restore" I can backup files but, whilst telling me I need 75GB for a System Image, System also tells me that my external Hard Disk with 900GB free space has insufficient space!Help
-
Hi, We are planning customize ESS/MSS (version 600) on EP 7 SP9 we created new Track in NWDI as explained in the following blog ESS/MSS Customization Make it Simple Then we added software component ESS 600 and MSS 600 in our track and checked in S