Can you accept two inputs on same line COBOL? - cobol

It's hard to explain but I have two columns one which is items ordered and one which is the price of an item. under the user needs to input the computers name and its price. The issue I'm having is I need to input on the same line and don't know how as I'm new to COBOL.
example of what its supposed to look like is
ITEMS ORDERED___________ Price
Computer: Dell______________ 250.00
I try using
display "ITEMS ORDERED Price".
display "Computer: "with no advancing.
accept DESCRIPTION-OF-LAPTOP with no advancing.
accept LAPTOP-PRICE.
This just ends up putting it to the very top of the command prompt for some reason.

With the standard ACCEPT statement, it is possible to enter two (or more) fields on the same line; however, this is accepted as a single data item which must then be parsed to separate the fields. Tabs may be entered to line up the data so that it appears to be in two columns.
ITEMS ORDERED Price
Computer: Dell 250.00
Computer: HP 275.00
Computer:
In these cases, I used three tabs. However, only a single space is required to separate the price from the name. so the entries could look like these and still be accepted:
ITEMS ORDERED Price
Computer: Dell 2.00
Computer: Dell 20.00
Computer: Dell 200.00
Computer: Dell 2000.00
Computer: Dell 2.00
Computer: Dell 20.00
Computer: Dell 200.00
Computer:
Additional code is required to clean, parse, and validate before saving the data. (I used about 60 additional lines of code for that purpose.)
With SCREEN SECTION, the exact placement and definition of each field is defined, therefore columns are aligned, parsing is not required, and validation is simplified.
SCREEN SECTION was added to the 2002 standard as a Processor-dependent item and is not necessarily available on every, otherwise conforming, compiler. However, the feature has been available, in some form, in compilers since the 1980s.

Related

Google Datastudio show empty row combinations

I am creating a Google Data Studio report for a car dealership and I have a problem.
I have made these 3 screenshots to illustrate:
If you see on the first screenshot, the datasource is pretty simple, used/new indicates weather the car being sold is new or used and if it is a sportscar or family car, and exchange/clean deal indicates weather the dealership takes/buys the customers old car in for a trade off in price. The rest should be self explanatory.
On screenshot2-3 you see my report, I have one table for each salesperson and it shows the amount of sales for each combination that has sales.
The problem is this, I want the tables to show each combination even if it does not have any sales at all, it should just show 0 then in record count. Like Mike on the left has more combinations than john, I still want Johns table to show those combinations just with a 0 then, and it should be sorted the same on each table so they look the same, just different data in the cells.
Is this possible to do?
To solve this problem, you need to make a combination of data, from the database with itself. Your main analysis dimension, which will generate your combinations, is used/new and Exchange/Clean deal. So your combination should be:
The filter defined in the second database (right base) must contain a filter telling which person the table will be destined for. So, for each table, you must make a new combination that contains the person-specific filter.
I just took a sample from your original database (10 first lines) and the result is:

linked sharing of google sheet tabs

I have a Google Sheet of 6 tabs. The intent is to create a role cost calculator and compare predicted to actual use.
One tab contains my master user list. It is the software used tab, just fyi.
Another tab is a slave tab which is the hardware used. That slave tab gets the user list from the software tab with the formula ={SoftwareByUser!A4:D160}
For each user, their hardware columns, E and beyond, are manually populated with integers that get multiplied by column costs to get a per user cost.
When an employee leaves our company I'd like to delete their row on the software tab. Imagine going from 51 total employees to 50 by removing row 26. Row 27-51 correctly become 26-50 on the software tab.
The trouble is the corresponding hardware row is not in removed, still having 51 rows in columns E and beyond, even though the number of rows in columns A-D have been reduced by the formula to the correct number of rows, 50. Hardware rows 26-51 no longer match their user.
I'm asking for a solution to do what I describe please. Is my thinking faulty and a different approach necessary?
What you should have to do is define an ID for each user (can be at least a first name / last name / date of birth concatenation). Then on the slave tabs manually type each one (do not link the two tabs for ID), then you can recall the master to slave tab using VLOOKUP with multiple column numbers at once. If one line is erased in master, or if the master is sorted, this will not affect the slave tab unless giving you an alert that the line has been erased.

How to OCR scanned voting protocols

As part of a hobby project I'm trying to digitalise all the voting records of the Swedish parliament to see if I can extract any interesting statistics (yes a strange hobby I know).
From 1983 to 2001 the voting records look something like in the example. They are printed from some kind of voting machine and only exist on paper (that are now scanned and on my disk).
Every vote consists of three pages with two columns each of members and votes as in the example.
Some translations from Swedish: (Plats = Seat, Ledamöter = Members, Parti = party, Röst = Vote).
The list is sorted on the party column and then alphabetically on the member column.
After an election a member stays on their seat until next election or that the member quits parliament and is replaced by a replacement member. There can also be temporary replacements.
Replacements are also sorted into the list.
The Parti/Party column contains the party abbreviation and can only be one of nine letters (since there are only nine different parties in that time period). Members stay with their party but can technically change between or during election periods.
The Röst/vote column can be one of J,N,A,F (Ja = Yey, Nej = Ney, Avstår = Pass, Frånvarande = Absent) and are also aligned in a four sub-columns.
The columns and rows are not always in the same place in the picture. It can both be slightly translated and/or rotated. The quality of the scan is also not always this good.
At the top of the first page (not shown i the example) there is a summation of votes per party that can be checked against.
There are about 18.000 votes in total.
For votes before to 1983 the layout was different and I was able to make a custom program in node.js (although most languages would be ok for me) that semi-automatically could scan the votes but this looks like something that should be easy to do with tesseract or something similar.
My question is really if its possible to hint tesseract about the layout so that it can do some better guesses of what the text is. I'm aware one can make a custom wordlist (where I could for example add all members names manually).
I'm guessing that there might be a way to make a custom pattern list but I haven't figured that out.
Does anyone have any good suggestions on how to tackle this?

Crystal Reports Crosstab with multiple row fields(attributes)

I'm designing a business analysis report using Crystal Report XI and oracle stored procedure as data source. Report contains a crosstab with one row (on the left) and summarized values under selling station names.
Requirement is to have multiple attribute columns on left like Product ID, Product Name, Product Color, Product Size, Product Sold Date etc and at the end, summarized values. What I've done so far is a crosstab with only one column at left and then summarized values.
Here is the sample of crosstab as required.
I've done plenty of R&D but didn't find any appropriate solution.
The output of report is required to match the format provided by business user.
So the solution I devised is here:
Crosstab is used to aggregate and jointly display the distribution of two or more variables by tabulating their results against one dimension. Problem was how to increase the number of dimensions. Since this is against logic of crosstab, so I modified my stored-procedure and created one single string by concatenating the dimensions and created a crosstab against it. These dimensions are separated by a delimiter '~' or you can use some other for better readability.

Joining data from different Excel spreadsheets onto a fourth using a common identifier

Issue and Goal
I have three csv files, the first one contains customer names and their unique customer numbers. The second csv file contains addresses, telephone numbers, plus unique customer numbers. The third contains order histories plus unique customer numbers.
I am trying to combine all three lists into a single Excel worksheet, with Customer names, addresses and order histories on the same line.
Desired Output
Customer #, Bob Brown, 100 Hill St, Los Angeles, CA 90006, 888-888-8888, Order History
Customer #, Tim Jones, 120 First St, San Diego, CA 91111, 888-888-8888, Order History
What I've tried thus far
I imported and copied each list into the same worksheet and used Vlookup to find the common identifiers. While it worked to find items that have matches, I have to manually cut and paste items that don't have matches. For instances, not all customers have order histories.
If someone knows of a way to automate this, that will be super! I realize Access is probably the better tool for this but my experience with Access is zero, zip, zilch, nada, nothing, "the big donut!"
Thanks.
why not import them via phpmyadm in into a database, then use join to join them all and then use the libexcel from php to output it.
thats what i would do.
or in excel
place all values in 3 diff sheets, copy all unique customer numbers to sheet 4 and then use vlookup ifunction in excel to combine data

Resources