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
 
change record values by condition

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

New User


Joined: 06 Apr 2006
Posts: 31

PostPosted: Wed Nov 19, 2008 9:42 pm    Post subject: change record values by condition
Reply with quote

Hi -

I need my first and last record in the file to be replaced based on a condition.

I have a file which has spaces in position 1-20 in first record and
low values in position 1-20 in last record.

I need to replace spaces in first record(40) to lowvalues(00) and
low-values(00) in last record to highvalues(FF)

Any body have any idea.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Nov 19, 2008 10:10 pm    Post subject:
Reply with quote

Assuming only the first record has blanks in 1-20 and only the last record has binary zeros in 1-20, you can use this DFSORT job to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,20,CH,EQ,C' '),
    OVERLAY=(1:20X'00')),
   IFTHEN=(WHEN=(1,20,BI,EQ,0),
    OVERLAY=(1:20X'FF'))
/*
Back to top
View user's profile Send private message
foliater

New User


Joined: 06 Apr 2006
Posts: 31

PostPosted: Wed Nov 19, 2008 10:57 pm    Post subject: Reply to: change record values by condition
Reply with quote

Works Perfect! Thank you.
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 Change NULL indicator in UNLOAD utility Khadhar Basha DB2 2 Fri Dec 15, 2017 3:01 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Squeeze record left so that zeroes ar... Vignesh Sid SYNCSORT 5 Fri Nov 10, 2017 1:40 pm

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