Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Fail to change physical VSAM filename... jacobdng CICS 0 Fri Jan 20, 2017 12:36 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us