View previous topic :: View next topic
|
Author |
Message |
Karthi89
New User
Joined: 06 Jan 2025 Posts: 4 Location: India
|
|
|
|
Hi,
I have a field length of 18( in the file it's defined as comp3 field as expanded below) in the 80 bytes file...I am trying to omit the records as below.
Field position 2 to 3 : value is 91
Field position 5 to 6 : values are 83, 69 and 68
In comp3 it defined as 10 bytes field starting position is 42 till 51. As in attachment if 43 position is having '91' and (if second nibble of 44 and first nibble of position 45 having values as 83, 69 and 68).
I thought of achieving it in a 2 step sort.
1. Converting PD to zd and write in the position 81 to 98 by creating a new file 98 bytes file
2. Omit cond based on the above scenario and write using outrec up to 80 bytes
Do we able to achieve this in a simpler code? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10890 Location: italy
|
|
|
|
DO NOT POST SCREENSHOTS
they clobber the browser window and make it unreadable
will please a moderator delete the screen shot
thank You |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1346 Location: Bamberg, Germany
|
|
|
|
Use the code button to provide sample data, AND preview anything before you post. |
|
Back to top |
|
|
Karthi89
New User
Joined: 06 Jan 2025 Posts: 4 Location: India
|
|
|
|
Karthi89 wrote: |
Hi,
I have a field length of 18( in the file it's defined as comp3 field as expanded below) in the 80 bytes file...I am trying to omit the records as below.
Field position 2 to 3 : value is 91
Field position 5 to 6 : values are 83, 69 and 68
In comp3 it defined as 10 bytes field starting position is 42 till 51. As in attachment if 43 position is having '91' and (if second nibble of 44 and first nibble of position 45 having values as 83, 69 and 68).
I thought of achieving it in a 2 step sort.
1. Converting PD to zd and write in the position 81 to 98 by creating a new file 98 bytes file
2. Omit cond based on the above scenario and write using outrec up to 80 bytes
Do we able to achieve this in a simpler code? |
can we use bit notations in omit conditions. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1346 Location: Bamberg, Germany
|
|
Back to top |
|
|
Karthi89
New User
Joined: 06 Jan 2025 Posts: 4 Location: India
|
|
|
|
I tried something as below and it isn't working as expected...No errors shown..
Inrec overlay=(81:42,10,pd,to=zd,length=18)
sort fields=copy
outrec ifthen=(when=82,2,zd,eq,91,and,(85,2,zd,eq,68,or,85,2,zd,eq,69)),build=(1,80)
Any suggestions pls? |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1346 Location: Bamberg, Germany
|
|
|
|
Show sample data as written before. Use the code button where appropriate. |
|
Back to top |
|
|
Karthi89
New User
Joined: 06 Jan 2025 Posts: 4 Location: India
|
|
|
|
Code: |
the pd format as x'0[b]11[/b]8[b]68[/b]290938000000'
I need to exclude the record has 11 and 68 as in below
Packed format as below starts at position 42 till 51
0188998000
016203000F
|
|
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2151 Location: USA
|
|
|
|
Karthi89 wrote: |
I have a field length of 18 (in the file it's defined as comp3 field as expanded below) in the 80 bytes file... |
The maximum size of any COMP-3 field allowed by IBM architecture is 16 bytes.
When you convert it TO=ZD,LENGTH=18, it is not COMP-3 anymore!
RTFM. |
|
Back to top |
|
|
|