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
 
add additional record in between records - DFSORT

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

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Aug 07, 2012 7:56 pm    Post subject: add additional record in between records - DFSORT
Reply with quote

Hi,

I have an input file (LRECL=80,RECFM=FB) with data as shown below:
Code:

----+----1----+----2----+----3
A1 NAME OF LENGTH 80         
A2 ADDR OF LENGTH 80         
A8 OTHR OF LENGTH 80         
ZZ ENDR OF LENGTH 80         
A1 DATA OF LENGTH 80         
A2 DATA OF LENGTH 80         
ZZ ENDR OF LENGTH 80         
A1 NAME OF LENGTH 80         
A2 ADDR OF LENGTH 80         
A7 MISC OF LENGTH 80         
ZZ ENDR OF LENGTH 80         
A1 NAME OF LENGTH 80         
A2 ADDR OF LENGTH 80         
A8 OTHR OF LENGTH 80         
ZZ ENDR OF LENGTH 80         


The above data has groups of records (each group of records start with A1 and ends with ZZ at 1st column). There are total 4 groups. My requirement is to insert A9 record after each A8 record if a group has got A8 record type. However, all the records should remain in the same order as they do appear in I/P file.

The expected output is like this:
Code:

----+----1----+----2----+----3
A1 NAME OF LENGTH 80         
A2 ADDR OF LENGTH 80         
A8 OTHR OF LENGTH 80         
A9 EXTR OF LENGTH 80         
ZZ ENDR OF LENGTH 80         
A1 DATA OF LENGTH 80         
A2 DATA OF LENGTH 80         
ZZ ENDR OF LENGTH 80         
A1 NAME OF LENGTH 80         
A2 ADDR OF LENGTH 80         
A7 MISC OF LENGTH 80         
ZZ ENDR OF LENGTH 80         
A1 NAME OF LENGTH 80         
A2 ADDR OF LENGTH 80         
A8 OTHR OF LENGTH 80         
A9 EXTR OF LENGTH 80         
ZZ ENDR OF LENGTH 80         


Is this possible with DFSORT v10 for z/OS? Please help.

Thanks.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Aug 07, 2012 8:10 pm    Post subject: Reply to: add additional record in between records - DFSORT
Reply with quote

Try an IFTHEN on OUTFIL and use the / (slash operator) when you get an A8. There are examples. Search for "slash operator".
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Aug 07, 2012 8:29 pm    Post subject: A9 EXTR OF LENGTH 80
Reply with quote

Bill, yes.......got the results.....thanks for the idea !!!

Code:

//SYSIN    DD *                               
 SORT FIELDS=COPY                             
 OUTFIL IFTHEN=(WHEN=(1,2,CH,EQ,C'A8'),       
 BUILD=(1,80,/,C'A9 EXTR OF LENGTH 80',60X)) 
//*                                           
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Aug 07, 2012 8:43 pm    Post subject: Reply to: add additional record in between records - DFSORT
Reply with quote

No problem. Thanks for posting your solution, it'll help someone else later.
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 Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am

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