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
 

 

Regenerating entries with a key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Regenerating entries with a key
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    Post subject:
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    Post subject: Reply to: Regenerating entries with a key
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    Post subject:
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    Post subject: Reply to: Regenerating entries with a key
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    Post subject: Reply to: Regenerating entries with a key
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    Post subject: Re: Reply to: Regenerating entries with a key
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    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 Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
No new posts Finding out consecutive date entries ... bhavya_sha DFSORT/ICETOOL 10 Fri Nov 20, 2015 3:24 pm
No new posts Get particular entries with a string ... ramsri JCL & VSAM 13 Mon Dec 23, 2013 8:57 pm
No new posts find matching entries from SORTOUT fo... ramsri JCL & VSAM 6 Thu Dec 12, 2013 4:33 pm
No new posts Batch JCL to define/install /FCT entr... shr_amar CICS 7 Thu Aug 15, 2013 4:36 pm


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