I have some data in a table and looks like the Input table below.
I would like to write a Teradata SQL to inspect the sequential records represented in the Input.
If the key which is composed of Ordernum, Name and Zip is duplicated, then keep one version of the key record with the earliest...
Hi,
We have some functionality in a pivot table in Excel where if you right click a pivot table data item, you can drill down on the cell and get the corresponding detail data from the Analysis Services cube. This is down via a drill down macro which resides in the Excel spreadsheet. This works...
Hi,
We have some functionality in a pivot table in Excel where if you right click a pivot table data item, you can drill down on the cell and get the corresponding detail data from the Analysis Services cube. This is down via a drill down macro which resides in the Excel spreadsheet. This works...
I am creating a pivot table based off a stored function in Excel.
It returns Job codes instead of Job names to a data sheet in excel.
Another tab has a pivot table which references this sheet.
I want to convert the Job code into Job names (possibly using a formula) in the pivot table rather...
I have some questions on the unload command.
I have a query such as:
Unload to c:\junk\test.txt delimiter ""
select
field1,
field2,
field3
from file1
Even though i put a delimiter of 2 double quotes. I still get pipes. Why?
Also if field1 and field2(both char (3)) are blank, the results are...
I am creating a PDF file on the mainframe, by reading a mainframe print file (FBA 133) and within a data_null statement outputting it to a PDF file using ODS.
When I ftp the results to the PC, the page breaks which appeared on the mainframe (in the first column) are not honored in the PDF. Is...
I would like to write a shell script to screen on some conditions for a given line and if valid perform 2 substitutions on that line otherwise the line shall remain as-is.
Here is the file:
1234NYABC1LMA
2334NJABC0TR3
4234NJABC1LMA
5234PAABC1LMA
8234SCABC1ZBC
If the state (columns 5 and 6) is...
I have a file and I wish to replace a specific column if it contains a value to another value
An example is below:
Input file
222222
121111
323333
I wish to replace the "2" in the 2nd column to a "9" , all other columns remain intact, so the output looks like this:
299999
191111
393333
Thanks
I have a field as below:
4 Field1 PIC 9(5) COMP-3.
What is the simplest way to extract the last digit of Field1?
Example
Field1 Last Digit
12345 5
45678 8
Field1 is always greater than 9999 and is always less than 100,000.
Thank You.
I have a v99999 packed number which i wish to convert to an alpha 8.
The following is the schema. A is the input, B I am using to unpack A, and C I am attempting to convert the unpacked number to the alpha, I wish to preserve the decimal point and sign (if there is any):
05 A...
I am trying to read in pic 9(5) comp-3 field as in:
4 AB-QTY PIC S9(5)V99 COMP-3.
and then write it out to a file stripping the COMP-3 format and also including a decimal point. This is what I did:
MOVE AB-QTY TO OUT-AB-AMT.
where OUT-AB-AMT is...
I tried the REWRITE and it worked correctly.
Another error I had in my original code I was initializing the record after reading it which set it to 0.
Eliminating that and inserting the REWRITE, it now works like a charm.
Thanks All.
I am trying to write a cobol program to read a file and increment the contents and write back to the same file, I am
trying to increment the first 4 bytes and write back the 4 bytes and the filler of 76.
Here is the code:
SPECIAL-NAMES.
INPUT-OUTPUT SECTION...
I am a newbie first time using UDB on Unix.
I am using the Load Wizard to load a flat file into a table.
All the values are specified in the flat file with the exception of 1 field - timestamp.
When I do the insert I would like to record in the table the time the record was inserted.
As an...
You were right, I copied it from PC and introduced the carriage control. Once corrected it works like a charm.
Thanks very much for your help!!!!!!!!!!!!!!
Do you know a good nawk tutorial so I can understand this solution better?
I got this error now:
/usr/xpg4/bin/awk: file "acc.awk": line 1: invalid character "^M" Context is:
>>> NR == FNR { arr[$0]; next }^M <<<
Here is my exact code from the calling script:
/usr/xpg4/bin/awk -f acc.awk accounts.txt target2.txt
and acc.awk:
NR == FNR { arr[$0]; next }...
I ran it as suggested above (using the exact syntax)and here is the error I got:
nawk: syntax error at source line 1
context is
<<< NR == FNR { arr[$0]; next >>> }
nawk: bailing out at source line 1
Any ideas?
Thanks
Sorry, here are the file formats:
File1
12345678901
23456789012
File2
12345678901ABCDEFGHIJ
23456789012DEFGHIJKLM
99999999999KLDSDDSDED
The account number is the only entry in File1, and the account number is in the beginning of File2.
Thanks
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.