IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Partial Sort conditions for PD fields


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Karthi89

New User


Joined: 06 Jan 2025
Posts: 4
Location: India

PostPosted: Mon Jan 06, 2025 11:02 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10890
Location: italy

PostPosted: Mon Jan 06, 2025 11:21 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1346
Location: Bamberg, Germany

PostPosted: Tue Jan 07, 2025 1:37 am
Reply with quote

Use the code button to provide sample data, AND preview anything before you post.
Back to top
View user's profile Send private message
Karthi89

New User


Joined: 06 Jan 2025
Posts: 4
Location: India

PostPosted: Tue Jan 07, 2025 8:59 am
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1346
Location: Bamberg, Germany

PostPosted: Tue Jan 07, 2025 9:19 am
Reply with quote

Yes. RTFM https://www.ibm.com/docs/en/zos/3.1.0?topic=statement-bit-logic-tests
Back to top
View user's profile Send private message
Karthi89

New User


Joined: 06 Jan 2025
Posts: 4
Location: India

PostPosted: Tue Jan 07, 2025 2:03 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1346
Location: Bamberg, Germany

PostPosted: Tue Jan 07, 2025 2:36 pm
Reply with quote

Show sample data as written before. Use the code button where appropriate.
Back to top
View user's profile Send private message
Karthi89

New User


Joined: 06 Jan 2025
Posts: 4
Location: India

PostPosted: Tue Jan 07, 2025 2:47 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2151
Location: USA

PostPosted: Tue Jan 07, 2025 7:02 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Help with SORT - I need to validate d... DFSORT/ICETOOL 11
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts Is this possible via sort (in one pass)? SYNCSORT 4
No new posts GDG generation name to GDG Base name ... DFSORT/ICETOOL 3
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
Search our Forums:

Back to Top