IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Regenerating entries with a key


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rajesh MS

New User


Joined: 12 May 2009
Posts: 5
Location: Chennai

PostPosted: Mon Jan 10, 2011 8:22 pm
Reply with quote

I have a VB file with entries as below

INPUT:
Code:
AAAA352XXX
BBBB352YYY
CCCD352WEF

Now, i need all records in the above file but with 352 replaced with 441 & 568.
My output should appear as below
Code:
AAAA352XXX
BBBB352YYY
CCCD352WEF
AAAA441XXX
BBBB441YYY
CCCD441WEF
AAAA568XXX
BBBB568YYY
CCCD568WEF
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Jan 10, 2011 11:05 pm
Reply with quote

Rajesh MS,

What is the LRECL and the format of the field to be replaced? Do you the generated entries at the end or can they be right after the record that is being repeated like shown below?

AAAA352XXX
AAAA441XXX
AAAA568XXX

BBBB352YYY
BBBB441YYY
BBBB568YYY

CCCD352WEF
CCCD441WEF
CCCD568WEF

What happens if a record does not have 352 ?
Back to top
View user's profile Send private message
Rajesh MS

New User


Joined: 12 May 2009
Posts: 5
Location: Chennai

PostPosted: Mon Jan 10, 2011 11:30 pm
Reply with quote

Skolusu,

LRECL is 50 and is a VB file. The output can be repeated as you mentioned.
For sure, there will be record with 352(key value in file)
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Jan 10, 2011 11:54 pm
Reply with quote

Rajesh MS,

Use the following DFSORT JCL. I assumed that your input has only 352 records and every records need to repeated twice.

Code:

//STEP0100 EXEC PGM=SORT             
//SYSOUT   DD SYSOUT=*               
//SORTIN   DD DSN=Your input VB lrecl 50 byte file,DISP=SHR
//SORTOUT  DD SYSOUT=*               
//SYSIN    DD *                       
  SORT FIELDS=COPY                   
  OUTFIL BUILD=(1,4,5,/,             
                1,4,5,4,C'441',12,/, 
                1,4,5,4,C'568',12)
//*
Back to top
View user's profile Send private message
Rajesh MS

New User


Joined: 12 May 2009
Posts: 5
Location: Chennai

PostPosted: Tue Jan 11, 2011 6:12 pm
Reply with quote

kolusu,

Thanks a lot!! It worked fine
Back to top
View user's profile Send private message
Rajesh MS

New User


Joined: 12 May 2009
Posts: 5
Location: Chennai

PostPosted: Wed Jan 12, 2011 11:36 pm
Reply with quote

Kolusu,

I am facing INCONSISTENT REFORMATTING FOR SORTOUT if I use the above jcl with recfm FB for LRECL 19.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jan 13, 2011 12:53 am
Reply with quote

Rajesh MS wrote:
Kolusu,

I am facing INCONSISTENT REFORMATTING FOR SORTOUT if I use the above jcl with recfm FB for LRECL 19.


I showed you a solution specifically for VB files. You can't take same the logic and apply it for a FB file. Vb files has RDW and and varying length records.

If the input file is FB and lrecl of 19 then use the following control cards
Code:

//SYSIN    DD *                       
  SORT FIELDS=COPY                     
  OUTFIL BUILD=(1,19,/,               
                1,4,C'441',8,12,/,     
                1,4,C'568',8,12)       
//*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Fault Analyzer not producing entries ... IBM Tools 19
No new posts ERROR - NO ESD ENTRIES, EXECUTION IMP... COBOL Programming 6
No new posts Calling procedure with multiple entri... PL/I & Assembler 5
No new posts Finding out consecutive date entries ... DFSORT/ICETOOL 10
No new posts Get particular entries with a string ... JCL & VSAM 14
Search our Forums:

Back to Top