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
 
Search all records and copy string only.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Feb 24, 2009 3:05 pm    Post subject: Search all records and copy string only.
Reply with quote

Hi,

I have an input file as given below with LRECL of 90 & RECFM of FB.

Requirement: Whenever there is a 6 digit number found in front of FIRM that content (10 characters) should be moved to the 1st position of output file. The Xs shown below actually contains some alphanumeric data and it is not constant value.

Sample Records:
Code:

PC2009-02-23XXXXXXXXXX291712FIRM
PC2008-07-11185980FIRMXXXXXXXXXX
PC2008-07-21XX581460FIRMXXXXXXXX
PC2008-07-22XX881360TRIMXXXXXXXX
PC2008-07-15XXXXX964785FIRMXXXXX
PC2008-07-16XXXX562780TERMXXXXXX
PC2008-07-30X056402FIRMXXXXXXXXX


Expected Output:
Code:

291712FIRMPC2009-02-23XXXXXXXXXX
185980FIRMPC2008-07-11XXXXXXXXXX
581460FIRMPC2008-07-21XXXXXXXXXX
964785FIRMPC2008-07-15XXXXXXXXXX
056402FIRMPC2008-07-30XXXXXXXXXX


Please help.

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

Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Tue Feb 24, 2009 10:00 pm    Post subject:
Reply with quote

Ramsri,

Here are SORT control statements that should produce your requested output:
Code:

//SYSIN  DD *                                                 
  INREC PARSE=(%01=(ABSPOS=1,FIXLEN=12),                       
               %02=(ENDAT=C'FIRM',FIXLEN=20),                   
               %03=(FIXLEN=20)),                               
        BUILD=(1:%01,                                           
              13:%02,JFY=(SHIFT=RIGHT),                         
              33:%03,JFY=(SHIFT=LEFT))     
  SORT FIELDS=COPY                     
  OUTFIL INCLUDE=(29,4,CH,EQ,C'FIRM',AND,23,6,ZD,EQ,NUM),       
         IFTHEN=(WHEN=INIT,BUILD=(23,6,29,4,1,12,13,10,33,10)),
         IFTHEN=(WHEN=INIT,                                     
                 BUILD=(1,22,23,20,SQZ=(SHIFT=LEFT,LENGTH=10)))
/*

However, since your file is FB/90, you may need to modify the the field lengths/positions based on your actual data. This example is based solely on the sample records you provided.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Feb 25, 2009 8:32 pm    Post subject: Reply to: Search all records and copy string only.
Reply with quote

Thanks a lot.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts Find a string in PS file opened in br... mukkas CLIST & REXX 3 Sat Feb 24, 2018 2:15 pm

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