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

Problem while trying to manipulate records using SORT


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

New User


Joined: 05 Nov 2014
Posts: 95
Location: India

PostPosted: Tue Jun 30, 2020 1:19 pm
Reply with quote

Hi Friends
I have a requirement to create a big sequential file of around 10000 records with one of the HEX field incrementing at position 57. I tried SORT to achieve this but I am not getting the desired results.

Could you please help ?

I am trying to change the field at 55th position to insert a number x'0000000102052f' with an increment of 1 whenever the first 3 bytes are not x'00000f'.

Please suggest.

Code:

//STEP001 EXEC PGM=SORT                                                 
//SORTIN   DD DSN=DTD.TEST.DATASET1,DISP=SHR                           
//SORTOUT  DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
 OPTION COPY                                                           -
 INREC IFTHEN=(WHEN=(1,3,PD,NE,X'00000F'))                             -
 OVERLAY=(57:SEQNUM,16,PD,START=X'00000001020052F',INCR=1)             
/*                                                                     
[/code]
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


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

PostPosted: Tue Jun 30, 2020 4:49 pm
Reply with quote

Sample (change offsets and lengths to your needs):
Code:
//INCR     EXEC PGM=ICEMAN       
//SORTIN   DD *                                 
ABC                                             
DEF                                             
/*                                             
//SORTOUT  DD SYSOUT=*                         
//SYSOUT   DD SYSOUT=*                         
//SYSIN    DD *                                 
 OPTION COPY                                   
 INREC IFTHEN=(WHEN=(1,3,BI,NE,X'00000F'),     
   OVERLAY=(50:SEQNUM,16,PD,START=1020052,     
            50:50,16,PD,TO=PDF))
* OUTFIL BUILD=(1:1,3,HEX,X,50,16,HEX)           
  END               
/*

Output:
Code:
****** **************************** Datenanfang ************************
000001 ABC                                                             
       CCC44444444444444444444444444444444444444444444440000000000001202
       1230000000000000000000000000000000000000000000000000000000000005F
------------------------------------------------------------------------
000002 DEF                                                             
       CCC44444444444444444444444444444444444444444444440000000000001203
       4560000000000000000000000000000000000000000000000000000000000005F
------------------------------------------------------------------------
****** **************************** Datenende **************************
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Tue Jun 30, 2020 6:56 pm
Reply with quote

amitc23 wrote:

I am trying to change the field at 55th position to insert a number x'0000000102052f' with an increment of 1 whenever the first 3 bytes are not x'00000f'.

Please suggest.

Code:

//STEP001 EXEC PGM=SORT                                                 
//SORTIN   DD DSN=DTD.TEST.DATASET1,DISP=SHR                           
//SORTOUT  DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
 OPTION COPY                                                           -
 INREC IFTHEN=(WHEN=(1,3,PD,NE,X'00000F'))                             -
 OVERLAY=(57:SEQNUM,16,PD,START=X'00000001020052F',INCR=1)             
/*                                                                     
[/code]

I don't see 55 but 57. What is that value 0- unsigned?
Back to top
View user's profile Send private message
amitc23

New User


Joined: 05 Nov 2014
Posts: 95
Location: India

PostPosted: Thu Jul 02, 2020 10:41 pm
Reply with quote

Thanks Joerg and Rohit. Checked the post today only. I wrote a small one time cobol program to achieve this. However will try this again when I get some time.
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 Getting error S000 U0016 (Cn Internal... JCL & VSAM 4
No new posts Is the Output of Sort/Join dependent ... DFSORT/ICETOOL 2
No new posts Trying to use sort to do two function... DFSORT/ICETOOL 14
No new posts Sort to extract lines DFSORT/ICETOOL 8
This topic is locked: you cannot edit posts or make replies. copy file 2 data into file1 for match... DFSORT/ICETOOL 4
Search our Forums:

Back to Top