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
 

 

Editing more than 1 field in a single record

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

New User


Joined: 31 Oct 2006
Posts: 48
Location: Chennai

PostPosted: Mon Feb 26, 2007 9:29 pm    Post subject: Editing more than 1 field in a single record
Reply with quote

Hi,

I have an request as follows:

The input file is as follows:
Code:
09  00
  9809
       
0000 

The input file is of LRECL 6.
It represents 3 variables each of length 2 characters(Totally 6 characters)

If any of the fields is SPACES, it should be replaced with '00'.

Note: More than 1 field can be spaces in a single record.

Please provide an optimum solution.

Thanks in advance.

Regards,
OP
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: Mon Feb 26, 2007 10:18 pm    Post subject:
Reply with quote

op,

Here's a DFSORT job that will I think you asked for. I assumed that if any character in a field is not '0'-'9', you want '00' for that field. If that's not what you want, then please explain exactly what you do want.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/6)
//SORTOUT DD DSN=...  output file (FB/6)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,2,FS,NE,NUM),OVERLAY=(1:C'00'),HIT=NEXT),
        IFTHEN=(WHEN=(3,2,FS,NE,NUM),OVERLAY=(3:C'00'),HIT=NEXT),
        IFTHEN=(WHEN=(5,2,FS,NE,NUM),OVERLAY=(5:C'00'))
/*
Back to top
View user's profile Send private message
op

New User


Joined: 31 Oct 2006
Posts: 48
Location: Chennai

PostPosted: Mon Feb 26, 2007 10:44 pm    Post subject: Re: Editing more than 1 field in a single record
Reply with quote

Hi Frank,

I got the answer. This was what i was expecting.

Thanks a lot.

Regards,
Om Prakash
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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
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 Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm


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