Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Problem while trying to manipulate records using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Problem while trying to manipulate records using SORT
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 User


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

PostPosted: Tue Jun 30, 2020 4:49 pm    Post subject:
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: 2467
Location: NY,USA

PostPosted: Tue Jun 30, 2020 6:56 pm    Post subject: Re: Problem while trying to manipulate records using SORT
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    Post subject: Reply to: Problem while trying to manipulate records using SORT
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Parsing more than 1000 columns in a s... ssuthagar SYNCSORT 10 Tue Sep 22, 2020 12:23 am
No new posts Group selective VB records - Trailer ... Premnath_TJ DFSORT/ICETOOL 12 Sun Sep 13, 2020 3:38 am
This topic is locked: you cannot edit posts or make replies. SORT the records based on the second ... Ramsee SYNCSORT 1 Wed Aug 19, 2020 3:01 pm
No new posts Required Date Format in Include Sort ... vivky_vivek DFSORT/ICETOOL 6 Fri Aug 14, 2020 6:52 am
No new posts to Insert Rows from File1 to File 2 ... Arun_Tupili DFSORT/ICETOOL 1 Thu Aug 13, 2020 6:22 pm

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us