View previous topic :: View next topic
|
Author |
Message |
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Hi,
Please let me know how to remove all the records having low-values (just not only x'00' but every possible low-value !!) from a PS file with 1 million records. What should be supplied in OMIT COND? Please help. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
ramsri wrote: |
Hi,
Please let me know how to remove all the records having low-values (just not only x'00' but every possible low-value !!) from a PS file with 1 million records. What should be supplied in OMIT COND? Please help. |
And what "low-values" other than X'00' are possible? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
And it isn't even Monday . . .
Please list all the hex values you want to OMIT. |
|
Back to top |
|
|
Gary McDowell
Active User
Joined: 15 Oct 2012 Posts: 139 Location: USA
|
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Since it is a user file we are not sure what are all the possibilities and just don't want to limit it to X'00' alone. So, we are looking for a possible solution to omit all 255 combinations (thanks to Gary). |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Confused from Brussels
If you want to omit all 255 possibilities, use IEBGENER or IEFBR14 to set up an empty file with the same attributes as the input file and it is done. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Or just amend the program not to read that dataset. Possibly do not create the dataset in the first place (but other programs may need it). |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
I've tried this piece of Easytrieve code but it works only on X'00' but not on any other values such as X'01', X'02'.......so on
Code: |
//SYSIN DD *
DEFINE FULL-NAME W 10 A VALUE ' '
JOB INPUT NULL
IF FULL-NAME LOW-VALUES
DISPLAY 'LOW-VALUES IN INPUT'
ELSE
DISPLAY FULL-NAME
END-IF
STOP
|
Can we conclude that either Easytrieve or SORT products can't handle it?
Thanks. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
I do not not know about easytrieve but it is simple in sort but you have to define what are 'low values'. A byte can have 255 values from x'00' to x'FF' - you said all 255 'low' values which means ALL values. IF your low values are consecutive - say x'00' to x'0A' then you can omit on LT x'10' or include on GT x'0A'. If your low values can be anywhere in a string then use the search function of your sort product (SS I think). |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
ramsri wrote: |
I've tried this piece of Easytrieve code but it works only on X'00' but not on any other values such as X'01', X'02'.......so on
Code: |
//SYSIN DD *
DEFINE FULL-NAME W 10 A VALUE ' '
JOB INPUT NULL
IF FULL-NAME LOW-VALUES
DISPLAY 'LOW-VALUES IN INPUT'
ELSE
DISPLAY FULL-NAME
END-IF
STOP
|
|
Has it occurred to you that LOW-VALUES actually has a meaning? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Why not talk directly with the user, telling them that the file is not correct, and ask them to do something about it.
Akatsukami - yes agreed, I have always been led to believe that low values was X'00' and X'00' alone |
|
Back to top |
|
|
Gary McDowell
Active User
Joined: 15 Oct 2012 Posts: 139 Location: USA
|
|
|
|
The VALUE you DEFINEd for FULL-NAME is 10-SPACES - hex '40404040404040404040'.
So, if you use an "IF" statement in Easytrieve to test your 10-byte field in hex be sure to use all 10 hex characters.
You could code in Easytrieve…
Code: |
IF FULL-NAME = X'40404040404040404040'
OR FULL-NAME = X'00000000000000000000'
*---
IF FULL-NAME = SPACES
OR FULL-NAME = LOW-VALUES |
|
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
ramsri,
I think you are confusing 'non-displayable characters' with low values.
If you eliminating records having x'00' to x'FF', then it would eliminate all records.
the alphabet 'A' which is displayable would have hex value of x'C1'
'B' would be x'C2' and so on.. all displayable characters like ABCD123456 have hex value for each digit. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Quote: |
I think you are confusing 'non-displayable characters' with low values. |
Ramsri has been a member for almost 5 years now so he should have been aware of what a 'low value' is and the bit patterns that make up a byte about 5 years ago! |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Quote: |
say x'00' to x'0A' then you can omit on LT x'10' or include on GT x'0A'. If your low values can be anywhere in a string then use the search function of your sort product (SS I think).
|
I will try this idea.......thanks. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If the values to be "kept" or the values to be "skipped" cannot be identified, the code cannot be implemented
When these values (one way or the other) your Sort produce, Easytrieve, and COBOL can do what is needed. So can any other programming language and some utilities.
The "doing" may be tedious, but is rather simple. |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Code: |
//STEP0001 EXEC PGM=SORT
//SORTIN DD *
--> X'01'
--> X'02'
A
B
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OMIT COND=(1,1,BI,LT,X'10')
//*
|
Output:
Thanks. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What about x'22', or x'15' or x'33' etc?
I suspect you might want lt x'40' . . .
Hex below spaces x'40':
Code: |
000002 hex table
88A4A88984444444444444444444444444444444444
8570312350000000000000000000000000000000000
--------------------------------------------------
000003 00 - 0F
0404040404040404040404040404040444FF464FC44
00102030405060708090A0B0C0D0E0F000000000600
--------------------------------------------------
000004 10 - 1F
1414141414141414141414141414141444FF464FC44
00102030405060708090A0B0C0D0E0F000100001600
--------------------------------------------------
000005 20 - 2F
2424242424242424242424242424242444FF464FC44
00102030405060708090A0B0C0D0E0F000200002600
--------------------------------------------------
000006 30 - 3F
3434343434343434343434343434343444FF464FC44
00102030405060708090A0B0C0D0E0F000300003600 |
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
maybe something like this might help
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
CHECK,'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
/*
//SORTIN DD *
234567
1234567
123 567
AAAA 67
AAAA367
ABCDEFG
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INCLUDE FORMAT=SS,
COND=(1,1,EQ,CHECK,&,
2,1,EQ,CHECK,&,
3,1,EQ,CHECK,&,
4,1,EQ,CHECK,&,
5,1,EQ,CHECK,&,
6,1,EQ,CHECK,&,
7,1,EQ,CHECK)
//*
|
Gerry |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Gerry, thanks for the idea. Our file has LRECL of 109. |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Modified Gerry's idea like below and got results......I need to experiment more
Code: |
//STEP0001 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
234567
1234567
123 567
AAAA 67
AAAA367
ABCDEFG
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,7,SS,NE,C' ')
|
Thanks. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What you have now is NOT going to do what you posted as the requirement. . .
The newest "code" will NOT remove "low-values" or anything other than a space. . .
It is worrisome that after at least 5 years of working with this environment the difference between a space, low-values, and other unprintable characters is still not understood. . . |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
I assumed that the space was actually a non-displayable character - so it could be most things below x'42' (on my system). |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
That is why i posted the first part of my little "hex table". . .
Maybe we'll get there. . .
d |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
ramsri,
You first have to decide, and be very clear about, what values you want to exclude records for.
You next need to be clear about a rule for applying the exclusion (like any character in the record, or any character in position 1-20, or in multiple positions, whatever).
You have 256 possibilities, from X'00' to X'FF'. Identify the hex values you want excluded. Show some sample data. LRECL, RECFM.
By all means experiment, but you really much be clear of your target. |
|
Back to top |
|
|
|