Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
keep position

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
anatol

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Tue Jun 19, 2018 6:44 am    Post subject: keep position
Reply with quote

Hi,

I have file fb 80 ... I need to eliminate for example A in position 1-10, but keep the rest of the record on the same position ... not shift it if I remove A

12345A67 123456
to
1234567 123456

if I use FINDREP it shift last 123456 one position left if I remove A.
Back to top
View user's profile Send private message

mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 310
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Jun 19, 2018 12:15 pm    Post subject:
Reply with quote

Assuming RECFM=FB and LRECL=80 and you want to replace the 'A' in column 1 to 10 with null, the below sort card should give you the desired output.

Code:
  OPTION COPY                                           
  INREC BUILD=(11,70,1,10)                               
  OUTREC FINDREP=(STARTPOS=71,ENDPOS=80,IN=C'A',OUT=C'')
  OUTFIL BUILD=(71,10,1,70)                             
Back to top
View user's profile Send private message
anatol

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Tue Jun 19, 2018 4:49 pm    Post subject: Reply to: keep position
Reply with quote

Thank you, but it's not what I am looking for. In other words - I need put additional blank before second 123456 only if I remove A .... second 123456 could be in any position in record ( this is just sample) . maybe in other words - I need to remove A in first word in the record and add one more blank between first word and second word in the record only if I remove A in first word
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 310
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Jun 19, 2018 5:02 pm    Post subject:
Reply with quote

Did you try running with that sort card.

Please post an actual sample of input and expected output.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8697
Location: Back in jolly old England

PostPosted: Tue Jun 19, 2018 5:19 pm    Post subject: Re: Reply to: keep position
Reply with quote

anatol wrote:
Thank you, but it's not what I am looking for. In other words - I need put additional blank before second 123456 only if I remove A .... second 123456 could be in any position in record ( this is just sample) . maybe in other words - I need to remove A in first word in the record and add one more blank between first word and second word in the record only if I remove A in first word

Perhaps if you could be bothered to tell us exactly what you really wanted, then the members that wish to help you will NOT be wasting their time giving incorrect solutions.

Maybe the expected output that you posted would have been a true reflection of what you wanted, but hey ho after 120+ posts YOU can't be arsed to use the code tags and then moan when the results aren't exactly to your spec.

Unfortunately psychic day was yesterday this week
Back to top
View user's profile Send private message
anatol

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Tue Jun 19, 2018 5:29 pm    Post subject: Reply to: keep position
Reply with quote

Sorry, I need just idea, not full solution. Maybe I cannot explain the problem, but I've tried my best.

Here is the result of suggested sort statements:
Code:

//STEP020  EXEC PGM=SORT,PARM='SIZE(MAX)'                         
//SORTIN   DD *                                                   
12345A67 123456                                                   
123A45 123456                                                     
12A34 123456                                                     
//SORTOUT  DD SYSOUT=*                                           
//SYSOUT    DD SYSOUT=*                                           
//SYSIN     DD *                                                 
  OPTION COPY                                                     
   INREC BUILD=(11,70,1,10)                                       
   OUTREC FINDREP=(STARTPOS=71,ENDPOS=80,IN=C'A',OUT=C'')         
   OUTFIL BUILD=(71,10,1,70)                                     


output is:
Code:

        CPU:     0 HR  00 MIN  00.00 SEC    SRB:     0 HR  00 MI
1234567 1 23456                                                 
12345 123 456                                                   
1234 1234 56                                                   
ICE201I 2 RECORD TYPE IS F - DATA STARTS IN POSITION 1         
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8697
Location: Back in jolly old England

PostPosted: Tue Jun 19, 2018 7:24 pm    Post subject:
Reply with quote

Is the output what you want, if not, please show us what you want
Have you tried changing it to a blank, as below rather than a NULL ?
Code:

//SYSIN     DD *                                                 
  OPTION COPY                                                     
   INREC BUILD=(11,70,1,10)                                       
*  OUTREC FINDREP=(STARTPOS=71,ENDPOS=80,IN=C'A',OUT=C'')   
   OUTREC FINDREP=(STARTPOS=71,ENDPOS=80,IN=C'A',OUT=C' ')             
   OUTFIL BUILD=(71,10,1,70)   
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 429
Location: USA

PostPosted: Tue Jun 19, 2018 7:39 pm    Post subject: Re: Reply to: keep position
Reply with quote

First, PARSE the input record to fixed positions and then use the above sort card. At the end, you need to use SQZ=(SHIFT=LEFT) to get the data in your original format again.

.
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
No new posts can we hardcode a value in db2 load c... ram_vizag DB2 2 Wed Feb 28, 2018 11:04 pm
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts ISREDIT - Position Cursor on the Comm... Tarique Anwer TSO/ISPF 5 Wed Feb 03, 2016 12:44 pm
No new posts Adjust Heading Position in Easytrieve thesumitk CA Products 4 Mon Dec 21, 2015 3:26 pm
No new posts set column position record? italo_pm CLIST & REXX 3 Wed May 27, 2015 2:18 am

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