Compares not working past the 4th char


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Compares not working past the 4th char
# 8  
Old 03-19-2018
So I guess the USS under ZOS 2.2 does things a bit different. Here is the answer from IBM

The issue here lies in the input
strings. awk's strings get converted to numbers and numbers to strings,
if the context of the program demands it. A string is converted to a
number by interpreting any numeric prefix of the string as numerals. For instance 37Jeff would be converted to 37. Hence, in your input files,
all the fields have a prefix of 000 which means that they are all
converted to 0 and are thus equal to awk.

To force a number to a string, you may prefix any numeric prefix with
the empty string "".

$ awk ' ""$1 == ""$2 { print $1,$2 }' awktest.txt


This worked for me for what I'm doing, and cured my headache.

Thanks to all you replied, it is appreciated
This User Gave Thanks to jgreene42 For This Post:
# 9  
Old 03-19-2018
Thanks for posting the "solution" (or explanation), and respect! to MadeInGermany for his educated guess!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Working with UTF char sqlplus

I have below SQL that I wasnt to run from a solaris machine using sqlplus select * from TABLE_NAME where regexp_like(field_value, 'Α|Β|Γ|Δ|Ε|Ζ|Η|Θ|Ι|Κ|Λ|Μ|Ν|Ξ|Ο|Π|Ρ|Σ|Τ|Υ|Φ|Χ|Ψ|Ω|α|β|γ|δ|ε|ζ|η|θ|ι|κ|λ|μ|ν|ξ|ο|π|ρ|σ|τ|υ|φ|χ|ψ|ω'); When I cat the file UTF char shows perfect however when i run... (1 Reply)
Discussion started by: varun22486
1 Replies

2. Programming

Invalid conversion from char* to char

Pointers are seeming to get the best of me and I get that error in my program. Here is the code #include <stdio.h> #include <stdlib.h> #include <string.h> #define REPORTHEADING1 " Employee Pay Hours Gross Tax Net\n" #define REPORTHEADING2 " Name ... (1 Reply)
Discussion started by: Plum
1 Replies

3. Programming

Perl 2 files compares

What do i need to do have the below perl program load 205 million record files into the hash. It currently works on smaller files, but not working on huge files. Any idea what i need to do to modify to make it work with huge files: #!/usr/bin/perl $ot1=$ARGV; $ot2=$ARGV; open(mfileot1,... (2 Replies)
Discussion started by: mrn6430
2 Replies

4. Programming

error: invalid conversion from ‘const char*’ to ‘char*’

Compiling xpp (The X Printing Panel) on SL6 (RHEL6 essentially): xpp.cxx: In constructor ‘printFiles::printFiles(int, char**, int&)’: xpp.cxx:200: error: invalid conversion from ‘const char*’ to ‘char*’ The same error with all c++ constructors - gcc 4.4.4. If anyone can throw any light on... (8 Replies)
Discussion started by: GSO
8 Replies

5. UNIX for Dummies Questions & Answers

In BIND 9.3 DNS trying to get past the 256 char limit in SPF TXT records

One way I was told to do was incase strings in quotes. But I was given this option if I can get it to work. Will this work for splitting up SPF records? I am try to make bx.example.com reference spf.eu.***, spfa.eu.***, spfb.eu.***, and spfc.eu.***. spf.eu.example.com 3600 IN TXT "v=spf1... (0 Replies)
Discussion started by: tmanx
0 Replies

6. Shell Programming and Scripting

how can i past environment variables?

i am asking to do somethings like: make use of 2 environment variables: ASS1_DATA_DIR specifies the location of the input data files ASS1_OUTPUT_DIR specifies the location of the output data files i have something like that; #set environment variables set VARIABLE1=ASS1_DATA_DIR... (5 Replies)
Discussion started by: mingming88
5 Replies

7. Programming

concat const char * with char *

hello everybody! i have aproblem! i dont know how to concatenate const char* with char const char *buffer; char *b; sprintf(b,"result.txt"); strcat(buffer,b); thanx in advance (4 Replies)
Discussion started by: nicos
4 Replies

8. Programming

Adding a single char to a char pointer.

Hello, I'm trying to write a method which will return the extension of a file given the file's name, e.g. test.txt should return txt. I'm using C so am limited to char pointers and arrays. Here is the code as I have it: char* getext(char *file) { char *extension; int i, j;... (5 Replies)
Discussion started by: pallak7
5 Replies

9. Shell Programming and Scripting

How to replace any char with newline char.

Hi, How to replace any character in a file with a newline character using sed .. Ex: To replace ',' with newline Input: abcd,efgh,ijkl,mnop Output: abcd efgh ijkl mnop Thnx in advance. Regards, Sasidhar (5 Replies)
Discussion started by: mightysam
5 Replies

10. What is on Your Mind?

Past Time

Dear UNIX Folks, I guess everyone of us like to know what sysadmin typically do during his free time. Not what he/she likes as an hobbies.. but what activities does he/she often indulge in other than facing the monitor. Maybe we can come up this a better stereo-typed for sysadmin. I... (8 Replies)
Discussion started by: izy100
8 Replies
Login or Register to Ask a Question