Getting errors while executing TDL code - excel

[Collection:ExcelLedgersCollection]
ODBC: "Driver={Microsoft Excel Driver (*.xls,*.xlsx,*.xlsm,*.xlsb)};DBQ=C:\Desktop\List.xls"
SQL: "Select * from [Items$]"
[Function: ImportFromExcel]
Variable :TotalEntries :Number
Variable :Count :Number
00: Set :TotalEntries :$$NumItems:ExcelLedgersCollection
10: Start Progress: ##TotalEntries :"Items Creation" : "Importing Items in" : ##SVCurrentCompany
20: Walk Collection: ExcelLedgersCollection
30: New Object :Ledger
40: Set Value :Barcode :$_1
50: Set Value :Name :$_2
60: Set Value :Quantity :$_3
70: Create Target
80: Show Progres : ##Count
90: Increment : Count
100: End Walk
110: End Progress
120: Msg Box : "Status" : "Ledgers from Excel Imported Successfully"
[#Menu: Gateway of Tally]
Add: Item: Before:##locQuit: "Import From Excel" :Call :ImportFromExcel
I ran the above code and I am getting the following two errors:
1 FUNCTION 'ImportFromExcel' LABEL:10 Invalid number of steps 2
FUNCTION 'ImportFromExcel' LABEL:10 Action execution failed!
The function basically tries to read the data from the excel file called List.xls. I have googled these two errors and I found some suggestions:
The OS + Tally + Microsoft Office should all be either 32 bit or 64 bit.
The excel file name extension should be xls instead of xlsx.
I have a 64 bit system and I have checked to make sure that both Office and Tally are 64 bit. Also, my file extension is .xls. Any other ideas as to why this might not be working?

After setting Totalentries on line 00 (it may be safer to modify the line number to 001), try printing Totalentries by giving the command 002: log: ##Totalentries. It seems to me there are no values in your ExcelLedgersCollection collection.

1st we tried with Ms Office 2007 it never worked.
But when we used Ms Office 2019 it worked properly.
Following code works fine under MS Office 2019
[#Menu:Gateway Of TAlly]
Add:Item:Ledgerimport:Call: Ledgerimport
[Collection : Ledgerimport]
ODBC : "Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=D:\Baby\Tally\TDL\Source1.xlsx"
SQL : "Select * From [Sheet1$]"
[Collection: ledsum]
Source Collection:Ledgerimport
Compute: lednm : $_1
;Compute: op:$$Number:$_3
Compute: pr:$_2
[Function:Ledgerimport]
Variable:var1:String
Variable:var2:String
;Variable:var3:String
00: Walk Collection: ledsum
01: Set: var1:$lednm
02: log:##var1
03: Set: var2:$op
04: log:##var2
07: New Object:Ledger
08: Set Value:Name:$$String:##var1
09: Set Value:Parent:"Sundry Debtors"
10: Set Value:Mailing name:"tst"
;11: Set Value: openingbalance:##var2
;
;12: Insert Collection Object:Address
;13: set Target:Address
;14: Set Value:Address:$$String:##var3;"Street1"
15: set Target:..
16: Create Target
17: End Walk
18: Msg Box: "warning" : "Ledger master created"
S.N.Ramkumar.
94444 52115

Related

Escaping a space in a properties file for WildFly with Oracle DB

I am having a hard time using an environment variable with a space in a properties file read by WildFly (24) in Linux using Oracle 19 in RDS. One like:
SELECT 1 FROM DUAL
The issue is that wildfly won't even parse the file if the spaces are in there with the normal quoting methods.
I have it setup so that variable is in a file called datasource.properties that gets read from standalone.conf where this variable sits:
JAVA_OPTS="$JAVA_OPTS -DDATABASE_CONNECTION_CHECK=${DATABASE_CONNECTION_CHECK}"
It's read in with the following in standalone.conf:
set -a
. /opt/wildfly_config/datasource.properties
set +a
That in turn gets populated in standalone.xml with:
<connection-url>${env.DATABASE_JDBC_URL}</connection-url>
I try putting it in quotes and oddly enough it doesn’t start at all. Standalone.sh is no longer able to parse it:
Error: Could not find or load main class 1 Caused by: java.lang.ClassNotFoundException: 1
I have tried many things such as:
DATABASE_CONNECTION_CHECK="SELECT{ }1{ }FROM{ }DUAL"
DATABASE_CONNECTION_CHECK="'SELECT 1 FROM DUAL'"
DATABASE_CONNECTION_CHECK='SELECT 1 FROM DUAL'
DATABASE_CONNECTION_CHECK="SELECT+1+FROM+DUAL"
DATABASE_CONNECTION_CHECK="SELECT\ 1\ FROM\ DUAL"
DATABASE_CONNECTION_CHECK="\"SELECT 1 FROM DUAL\""
DATABASE_CONNECTION_CHECK="\"'SELECT 1 FROM DUAL'\""
DATABASE_CONNECTION_CHECK="SELECT%201%20FROM%20DUAL"
DATABASE_CONNECTION_CHECK="SELECT\{ }1\{ }FROM\{ }DUAL"
DATABASE_CONNECTION_CHECK='SELECT{ }1{ }FROM{ }DUAL'
DATABASE_CONNECTION_CHECK="'SELECT{ }1{ }FROM{ }DUAL'"
DATABASE_CONNECTION_CHECK="''SELECT{ }1{ }FROM{ }DUAL''"
DATABASE_CONNECTION_CHECK="SELECT%1%FROM%DUAL"
(I realize some of these don't make sense but I was looking for anything different.)
Startup looks good in the log output this with some of these, but then java doesn’t like it, for some reason it sees the escape usage:
Caused by: Error : 936, Position : 9, Sql = SELECT+1+FROM+DUAL, OriginalSql = SELECT+1+FROM+DUAL, Error Msg = ORA-00936: missing expression
or
Caused by: Error : 911, Position : 6, Sql = SELECT%1%FROM%DUAL, OriginalSql = SELECT%1%FROM%DUAL, Error Msg = ORA-00911: invalid character
or
WARN [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (ServerService Thread Pool -- 46) IJ030027: Destroying connection that is not valid, due to the following exception: oracle.jdbc.driver.T4CConnection#2c1456f8: java.sql.SQLException: Non supported SQL92 token at position: 7
This last one is the only one that really netted anything different. I got that with:
DATABASE_CONNECTION_CHECK="SELECT{}1{}FROM{}DUAL"
I can use sed to change the value in the standalone.xml, but all of the other properties I am doing work fine with the exception of this one. I had a hard time with a semicolon in the jdbc string with MSSQL and putting the semicolon in braces like "{;}" fixed that. This DB apparently does not follow the same syntax.
Is there an encoding type that will help this with Oracle and keeps wildfly happy?
EDIT: More tests:
DATABASE_CONNECTION_CHECK=\"SELECT' '1' 'FROM' 'DUAL\"
gets
Caused by: Error : 900, Position : 0, Sql = "SELECT 1 FROM DUAL", OriginalSql = "SELECT 1 FROM DUAL", Error Msg = ORA-00900: invalid SQL statement'
(doesn't seem to like the quotes)
But without the escaping of the quotes I get:
Caused by: Error : 923, Position : 9, Sql = SELECT' '1' 'FROM' 'DUAL, OriginalSql = SELECT' '1' 'FROM' 'DUAL, Error Msg = ORA-00923: FROM keyword not found where expected
A better solution was to change the sourcing of the file from:
set +a
. /opt/PrimeKey/wildfly_config/datasource.properties
set -a
to
. /opt/PrimeKey/wildfly_config/datasource.properties
and make it so all the variables brought in were variables and not properties:
export DATABASE_CONNECTION_CHECK="SELECT 1 FROM DUAL"

How do I fix USER FATAL MESSAGE 740?

How do I fix USER FATAL MESSAGE 740? This error is generated by Nastran when I try to run a BDF/DAT file of mine.
*** USER FATAL MESSAGE 740 (RDASGN)
UNIT NUMBER 5 HAS ALREADY BEEN ASSIGNED TO THE LOGICAL NAME INPUT
USER ACTION: CHANGE THE UNIT NUMBER ON THE ASSIGN STATEMENT AND IF THE UNIT IS USED FOR
PARAM,POST,<0 THEN SPECIFY PARAM,OUNIT2 WITH THE NEW UNIT NUMBER.
AVOID USING THE FOLLOWING UNIT NUMBERS THAT ARE ASSIGNED TO SPECIAL FILES IN MSC.NASTRAN:
1 THRU 12, 14 THRU 22, 40, 50, 51, 91, 92. SEE THE MSC.NASTRAN INSTALLATIONS/OPERATIONS
GUIDE SECTION ON MAKING FILE ASSIGNMENTS OR MSC.NASTRAN QUICK REFERENCE GUIDE ON
ASSIGN PHYSICAL FILE FOR REFERENCE.
Below is the head of my BDF file.
assign userfile='SUB1_PLATE.csv', status=UNKNOWN, form=formatted, unit=52
SOL 200
CEND
ECHO = NONE
DESOBJ(MIN) = 35
set 30=1008,1007,1015,1016
DESMOD=SUB1_PLATE
SUBCASE 1
$! Subcase name : DefaultLoadCase
$LBCSET SUBCASE1 DefaultLbcSet
ANALYSIS = STATICS
SPC = 1
LOAD = 6
DESSUB = 99
DISPLACEMENT(SORT1,PLOT,REAL)=ALL
STRESS(SORT1,PLOT,VONMISES,CORNER)=ALL
BEGIN BULK
param,xyunit,52
[...]
ENDDATA
Below is the solution
Correct
assign userfile='SUB1_PLAT.csv', status=UNKNOWN, form=formatted, unit=52
I shortened the name of CSV file to SUB1_PLAT.csv. This reduced the length of the line to 72 characters.
Incorrect
assign userfile='SUB1_PLATE.csv', status=UNKNOWN, form=formatted, unit=52
The file management section is limited to 72 characters, spaces included. The incorrect line stretches 73 characters. The nastran reader ignores the 73rd character and on. Instead of reading "unit=52" the reader reads "unit=5" which triggers the error.
|<--------------------- 72 Characters -------------------------------->||<- Characters are ignored truncated ->
assign userfile='SUB1_PLATE.csv', status=UNKNOWN, form=formatted, unit=52
References
MSC Nastran Reference Guide
The records of the first four sections are input in free-field format
and only columns 1 through 72 are used for data. Any information in
columns 73 through 80 may appear in the printed echo, but will not be
used by the program. If the last character in a record is a comma,
then the record is continued to the next record.

Cobol - syntax error, unexpected $undefined, expecting "end of file"

I have a problem with syntax in cobol. I'm using open-cobol package on Ubuntu 4.2.0-16-generic, and i've got error:
~/cobol$ cobc -free -x -o cal cal.cbl
cal.cbl:6: Error: syntax error, unexpected $undefined, expecting "end of file"
My cal.cbl file:
IDENTIFICATION DIVISION.
PROGRAM-ID. cal.
ENVIRONMENT DIVISION.
DATA DIVISION.
?? OPTION PIC 9 VALUE ZERO.
?? NUM1 PIC 9(5)V9(2) VALUE ZERO.
?? NUM2 PIC 9(5)V9(2) VALUE ZERO.
?? RESULT PIC 9(10)V9(2) VALUE ZERO.
PROCEDURE DIVISION.
ACCEPT OPTION.
DISPLAY "INSERT FIRST OPTION".
ACCEPT NUM1.
DISPLAY "INSERT SECOND OPTION".
ACCEPT NUM2.
STOP RUN.
I'm new in cobolt, i know something about columns and thats why I'm using -free flag to compile, but this error have no sense for me.
Why this error occurs, please help:)
?? is no valid COBOL word and no level number (which is needed in line 6). These messages come from OpenCOBOL/GnuCOBOL 1.1.
Newer GnuCOBOL versions are much better in many ways, including user messages (here with GC 2.2):
cal.cob: 6: Error: Invalid symbol: ? - Skipping word
cal.cob: 6: Error: PROCEDURE DIVISION header missing
cal.cob: 6: Error: syntax error, unexpected Identifier
cal.cob: 7: Error: Invalid symbol: ? - Skipping word
cal.cob: 7: Error: syntax error, unexpected Identifier
cal.cob: 8: Error: Invalid symbol: ? - Skipping word
cal.cob: 8: Error: syntax error, unexpected Identifier
cal.cob: 9: Error: Invalid symbol: ? - Skipping word
cal.cob: 9: Error: syntax error, unexpected Identifier
cal.cob: 11: Error: syntax error, unexpected PROCEDURE
cal.cob: 12: Error: 'OPTION' is not defined
cal.cob: 15: Error: 'NUM1' is not defined
cal.cob: 17: Error: 'NUM2' is not defined
Change ?? to 01 or 77 and you don't have the error any more. Insert WORKING-STORAGE SECTION or LOCAL-STORAGE SECTION after DATA DIVISION and your program compiles fine.
Get the Programmer's Guide for knowing more about COBOL.

Why read.clipboard is not working in R

Why is read.clipboard() not working on my system?
> library(psych)
> read.table(text=read.clipboard(), sep="\t", header=T, stringsAsFactors=F, strip.white=T)
Error in textConnection(text, encoding = "UTF-8") :
invalid 'text' argument
In addition: Warning message:
In read.table(file("clipboard"), header = TRUE, ...) :
incomplete final line found by readTableHeader on 'clipboard'
> read.table(text=readClipboard(), sep="\t", header=T, stringsAsFactors=F, strip.white=T)
Error in textConnection(text, encoding = "UTF-8") :
could not find function "readClipboard"
The version information:
> packageVersion('psych')
[1] ‘1.4.8.11’
> R.version
_
platform i486-pc-linux-gnu
arch i486
os linux-gnu
system i486, linux-gnu
status
major 3
minor 1.1
year 2014
month 07
day 10
svn rev 66115
language R
version.string R version 3.1.1 (2014-07-10)
nickname Sock it to Me
>
EDIT:
As suggested by #RichardScriven, I used following:
read.table('clipboard', sep="\t", header=T)
If I copy some cells in a spreadsheet and try above command, it does not work. Following is the error:
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") : clipboard cannot be opened or contains no text
But if I paste first to a text editor, and copy it again from there, then the above command works well.
How can I directly use the data after copying from a spreadsheet?
Following command also shows same problem, works when copied from text editor but not when copied from spreadsheet. I produces same error.
> read.clipboard(sep="\t", header=T)
Error in open.connection(file, "rt") : cannot open the connection
In addition: Warning message:
In open.connection(file, "rt") :
clipboard cannot be opened or contains no text
read.clipboard(sep="\t",header = T)
The above code should work. Also please note that you need to copy [from excel / libreoffice etc] , go to R script and run the command in R. If you perform any other commands in between, this might not work. Hope this helps.

Mbasic Input value

Using MBasic on an old CP/M trying to get a simple input which seems to not be working
10 INPUT "Your Name:", NAME$
20 PRINT "Hello, " + NAME$ + ","
I am just working threw this, never used it before. Its a program for an old CPM
When i Run this i get
Syntax error in 10
The correct syntax is LINE INPUT with a semi-colon, i.e.
10 LINE INPUT "Your name:"; NAME$
Microsoft BASIC Compiler 1980

Resources