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

Cant find hex value using IFTHEN=(WHEN


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

New User


Joined: 06 Apr 2021
Posts: 58
Location: argentina

PostPosted: Wed Jun 09, 2021 1:43 pm
Reply with quote

Hello, how are you?

Code:
//SORT0240 EXEC SORTC                                     
//* INPUT                                                 
//SORTIN   DD DSN=DM.BE.one,         
//            DISP=SHR                                   
//* OUTPUT                                               
//SORTOUT  DD DSN=DM.BE.two,   
//            DISP=(NEW,CATLG),UNIT=SYSDA,               
//            SPACE=(CYL,(1500,150),RLSE),VOL=(,,,9),     
//            DCB=(RECFM=VB,LRECL=974,BLKSIZE=0,DSORG=PS)
//SYSOUT   DD SYSOUT=*                                   
//SYSUDUMP DD SYSOUT=*                                   
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                       
  OUTREC IFTHEN=(WHEN=((21,1,ZD,EQ,0,OR,21,1,ZD,EQ,2),   
    AND,(17,1,CH,EQ,X'09')),BUILD=(1,24,C'3',26,949))     
    OPTION STOPAFT=1000                                   


I want to search this secuential file in order to change the pos 24.
When I try to use this code no expected change happend, but if I delete the this --->(17,1,CH,EQ,X'09') the expected changes do happen, so I think im doing something wrong with the hex search i quoted.

the secuencial file is like this

----+----1----+----2-

  ¦ & 1211D 0027

(the hex number is in pos 17, the empty space, if I activate the HEX mode, I can see 0)
9

The input file is a secuencial that I converted from a VSAM with REPRO.

------------------------------------------------------------------------
Really I tried to figure out the solution but I cant found it.

as always thank you.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


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

PostPosted: Wed Jun 09, 2021 1:49 pm
Reply with quote

What happens when you change (17,1,CH,EQ,X'09') to (17,1,BI,EQ,X'09')?

Also please post this:
Quote:
----+----1----+----2-

¦ & 1211D 0027
in Hex mode and use code tags for that.
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1188

PostPosted: Wed Jun 09, 2021 2:16 pm
Reply with quote

There is no need for SORT to previous conversion of VSAM to PS. SORT can work easily with VSAM input.

There might be conversion of RECFM between VB and FB, which also affected field positions. You need to verify the ACTUAL input to SORT, not the original VSAM data if you converted with REPRO.
Back to top
View user's profile Send private message
Ali_gezer

New User


Joined: 06 Apr 2021
Posts: 58
Location: argentina

PostPosted: Wed Jun 09, 2021 5:51 pm
Reply with quote

Joerg.Findeisen wrote:
What happens when you change (17,1,CH,EQ,X'09') to (17,1,BI,EQ,X'09')?

Also please post this:
Quote:
----+----1----+----2-

¦ & 1211D 0027
in Hex mode and use code tags for that.


Hello, this is not working. I have to say that the buid command I give it a parameter of 24 (BUILD=(1,24,C'3',26,949)) and it correctly change the position at pos 21, (yes, i have to put 24 to change the pos 21)

Code:
----+----1----+----2-

  ¦ & 1211D 0027
Back to top
View user's profile Send private message
Ali_gezer

New User


Joined: 06 Apr 2021
Posts: 58
Location: argentina

PostPosted: Wed Jun 09, 2021 5:53 pm
Reply with quote

sergeyken wrote:
There is no need for SORT to previous conversion of VSAM to PS. SORT can work easily with VSAM input.

There might be conversion of RECFM between VB and FB, which also affected field positions. You need to verify the ACTUAL input to SORT, not the original VSAM data if you converted with REPRO.


Yes, when I see the input in the pos 17 I can finde the empty space and there is the HEX value, but when, as I said, searh in that 17 position it cant find the value searched.
Back to top
View user's profile Send private message
Ali_gezer

New User


Joined: 06 Apr 2021
Posts: 58
Location: argentina

PostPosted: Wed Jun 09, 2021 5:59 pm
Reply with quote

Code:
//REPR0220 EXEC PGM=IDCAMS                                     
//* INPUT                                                     
//DD1      DD DSN=DM.BE.MAES90.VSAM,DISP=SHR   
//* OUTPUT                                                     
//DD2      DD DSN=DM.BE.one,               
//            DISP=(NEW,CATLG),UNIT=SYSDA,                     
//            SPACE=(CYL,(1500,150),RLSE),VOL=(,,,9),         
//            DCB=(RECFM=VB,LRECL=974,BLKSIZE=0,DSORG=PS)     
//SYSOUT   DD SYSOUT=*                                         
//SYSPRINT DD SYSOUT=*                                         
//SYSUDUMP DD SYSOUT=*                                         
//SYSIN    DD *                                               
    REPRO INFILE(DD1) OUTFILE(DD2)                             
/*                                                             


this is the repro step, the original vsam have a RECSZ(320 970)
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1188

PostPosted: Wed Jun 09, 2021 6:43 pm
Reply with quote

1) absolutely no need for REPRO. Never do things more complicated than they are, if not strictly needed.

2) remains unclear: are the field positions counted keeping in mind the RDW from RECFM=VB, or not?

3) It would be more useful to trace the actual values of ALL involved fields, converted to printable format, rather to guess what they may, or should be equal to?
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


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

PostPosted: Wed Jun 09, 2021 11:15 pm
Reply with quote

When processing VSAM directly, have a look at DFSORT's RECORD TYPE=V|F option.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2772
Location: NYC,USA

PostPosted: Thu Jun 10, 2021 7:41 am
Reply with quote

You need to add RDW +4 bytes to all starting positions in the INCLUDE and retry.
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1188

PostPosted: Thu Jun 10, 2021 11:14 am
Reply with quote

Rohit Umarjikar wrote:
You need to add RDW +4 bytes to all starting positions in the INCLUDE and retry.

Instead of all these attempts to guess any of possible issues, the standard proven method should always be: tracing all involved data values during the test run
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2772
Location: NYC,USA

PostPosted: Thu Jun 10, 2021 4:33 pm
Reply with quote

I am not guessing , I have tested yesterday against X’09’ if that’s what you need to know. It’s a simple INCLUDE to work as it works for any VB DS unless offsets are set wrong.
Second TS don’t need BUILD , simple OVERLAY should do. I wonder shouldn’t that be 1,25 than 1,24 to see changes at 21st position?
Please start debugging one INCLUDE condition at a time.
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1188

PostPosted: Thu Jun 10, 2021 6:24 pm
Reply with quote

Rohit Umarjikar wrote:
I am not guessing , I have tested yesterday against X’09’ if that’s what you need to know. It’s a simple INCLUDE to work as it works for any VB DS unless offsets are set wrong.
Second TS don’t need BUILD , simple OVERLAY should do. I wonder shouldn’t that be 1,25 than 1,24 to see changes at 21st position?
Please start debugging one INCLUDE condition at a time.

In order to make all these decisions - everyone, in every case, must first of all to clearly trace all the data values used in his own test, before hurrying to the forum and screaming: “Help! What is wrong in my super-excellent code??!!”
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2772
Location: NYC,USA

PostPosted: Thu Jun 10, 2021 6:46 pm
Reply with quote

Agree. We are all saying the same thing, let us just wait for TS to retry on what is suggested.
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 Multiple find/replace on the same dat... DFSORT/ICETOOL 4
No new posts Cobol code- to find a string in a str... COBOL Programming 3
No new posts Find library of PGM TSO/ISPF 10
This topic is locked: you cannot edit posts or make replies. REXX to find /* Define and write the ... CLIST & REXX 5
No new posts How to find orphaned MCDS D records. JCL & VSAM 18
Search our Forums:

Back to Top