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
 

 

How to OMIT Records and remove commas from Inputfile

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

New User


Joined: 21 Nov 2012
Posts: 3
Location: Switzerland

PostPosted: Thu Nov 22, 2012 9:11 pm    Post subject: How to OMIT Records and remove commas from Inputfile
Reply with quote

Hi

I have a FB=256 Inputfile like this:

LST00,O,7D3B,B20034, ,A5AA,002107,900,HTC,75,000000053207,Y,16,
LST00,O,7D3C,B20035, ,A5AA,002107,900,HTC,75,000000053207,Y,16,
LST00,O,7D3D,B20379, ,A5AA,002107,900,HTC,75,000000053207,Y,16,
LST00T, 100022472, 95387886, 26683680,


Now I want first to OMIT all Records starting with 'LST00,'
And second to remove the Coma's on one hand and on the other I want the Value 'LST00T,' on the remaining Record beeing removed too so the ...


.... Result should look like this:
100022472 95387886 26683680


Thanks in advance for your help.
Andy
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu Nov 22, 2012 9:32 pm    Post subject:
Reply with quote

INCLUDE only LST00T records and those records REPLACE ',' by ''

Examples available in forum
Back to top
View user's profile Send private message
Andy Gyr

New User


Joined: 21 Nov 2012
Posts: 3
Location: Switzerland

PostPosted: Fri Nov 23, 2012 4:35 pm    Post subject: ..with this parameter it works fine ...
Reply with quote

Code:
//SYSIN   DD *                                   
  SORT     FIELDS=COPY                           
  INCLUDE COND=(1,7,SS,EQ,C'LST00T,')             
  INREC FINDREP=(IN=C',',OUT=C' ')               
  OUTREC FINDREP=(IN=C',',OUT=C' ')               
/* 



Thanks a lot for the fast reply icon_smile.gif

Andy

Code'd
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri Nov 23, 2012 4:44 pm    Post subject:
Reply with quote

Code:
//SYSIN   DD *
  SORT FIELDS=COPY
  INCLUDE COND=(1,6,CH,EQ,C'LST00T')
  OUTFIL FINDREP=(INOUT=(C',',C''))


should suffice
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Nov 23, 2012 4:49 pm    Post subject: Reply to: How to OMIT Records and REMOVING COMA's etc. from
Reply with quote

Please use the Code tags to preserve spacing for what you post.

Pandora-Box is correct, unless you have a possible leading character for LST00T.

The FINDREP can be specified on INREC, OUTREC or OUTFIL, as well as in an IFTHEN. But you only need one FINDREP in your case, as you are only doing one thing, and all the commas on a record will be replaced by space with the FINDREP.

FINDREP can be limited by start-position, end-position and the number of replacements to make. Check the DFSORT manual for full details of FINDREP any anything else when you need to know it.
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Fri Nov 23, 2012 4:54 pm    Post subject:
Reply with quote

Please use below mentioned sort card for removing LST00T in output record.

Code:
//SYSIN  DD  *                         
 SORT FIELDS=COPY                     
 INCLUDE COND=(1,6,CH,EQ,C'LST00T')   
 OUTFIL FINDREP=(INOUT=(C',',C''))     
 OUTREC FIELDS=(1:8,73)               
/*                                     


Output:

Code:
********************************* TOP OF DATA **********************************
 100022472 95387886 26683680                                                   
******************************** BOTTOM OF DATA ********************************


Note: I assumed your record length as 80.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Nov 23, 2012 5:00 pm    Post subject: Reply to: How to OMIT Records and remove commas from Inputfi
Reply with quote

Andy, of the quick edit, if you change your SS to CH that bit'll be fine. Everyone 'cept Sai forgot that you wanted to drop the field after you'd found it.

Sai, did you mean to put the OUTREC on the OUTFIL? There is no need for changes in two places, they can both be on INREC or OUTREC or OUTFIL.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri Nov 23, 2012 6:09 pm    Post subject:
Reply with quote

Bill & Sai,

You still dont need to use outrec but replace C'LST00T, ' by C''
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Nov 23, 2012 6:38 pm    Post subject: Reply to: How to OMIT Records and remove commas from Inputfi
Reply with quote

Interesting idea, Pandora-Box, however, since the replacement of "LST00T, " is in a fixed position, the FINDREP should reflect that, which would require two FINDREPs, so then need two of INREC/OUTREC/OUTFIL or using IFTHEN.

Danger with not doing that would be the unfortunate circumsance of finding "LST00T, " somewhere else in the record. Might be fine for a given file, but then copy the code for another file, and hand the primed grenade to Support... It would also do a lot of unneeded processing if you let FINDREP rip across the entire record when it doesn't need to.
Back to top
View user's profile Send private message
Andy Gyr

New User


Joined: 21 Nov 2012
Posts: 3
Location: Switzerland

PostPosted: Fri Nov 23, 2012 6:47 pm    Post subject:
Reply with quote

Hi to all the 'helpers'

The Code of pandora works fine!


One more (additional) question:

How would the code look like if I want to insert a line.
This line should contain a columns-name but on the same positions as the datas.

Output then should look like:
Code:

COLUMNS-1     COLUMNS-2         COLUMNS-3        COLUMNS-4        COLUMN
LST00T        100022472         95387886         21066116         200773
LST00T        100022472         95387886         20795781         198359



Once again. Thanks to all involved icon_lol.gif
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Nov 23, 2012 6:50 pm    Post subject: Reply to: How to OMIT Records and remove commas from Inputfi
Reply with quote

Have a look at the OUTFIL reporting functions, for instance HEADERn and specifically HEADER1. Lots of examples if you search here.
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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts how to split records based on specifi... Venkata Ramayya DFSORT/ICETOOL 6 Wed Sep 28, 2016 3:20 am


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