Eliminate Junk data in string

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
gyt3
Member
Posts: 7
Joined: Sun Dec 16, 2012 9:46 am

Eliminate Junk data in string

Post by gyt3 » Sun Feb 10, 2013 1:26 pm

My input file is a comma delimited file and it looks like this,
a1234,123,345,1200,
b1234,123,345,19000,
c1234,123,345,1,
Sometimes, I may junk data in the input file like this
a1234,123,345,1200,
b1234,12fgdhg#$#%#$^$%&&
c1234,123,345,1,

If i get a junk data, I need to move the junk values to a separate file and process the rest of data in my program.

Junk Output file :
b1234,12fgdhg#$#%#$^$%&&

Can this be done using Overflow in Unstring or some other option ??
Can someone help me how to eliminate the junk and write the junk into a seperate output file.
Last edited by gyt3 on Sun Feb 10, 2013 6:27 pm, edited 1 time in total.

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Sun Feb 10, 2013 3:35 pm

You should not multi-post - it is rude and wastes other peoples' time. I have locked the other topic that I found after deleteing the solution to your problem which I am NOT going to waste time by repeating here.
Regards
Nic

gyt3
Member
Posts: 7
Joined: Sun Dec 16, 2012 9:46 am

Post by gyt3 » Sun Feb 10, 2013 6:24 pm

Hi Nic,

Thanks a lot for educating me that I should not multi-post.I was in need of an urgent solution so I posted in two different forums which I know.

Though you dint clear my technical doubt, you helped me out in knowing that I should not multi post.

THANKS.

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Mon Feb 11, 2013 3:26 am

OK, but you should also know that a forum is not a place to get urgent answers as the people help on a voluntary basis and if they feel so inclined so it could be that your question will never be answered on the forum. Although it probably will be - at some time.
Regards
Nic

chandurokzz
Member
Posts: 2
Joined: Thu Jan 10, 2013 10:22 am

Post by chandurokzz » Tue Feb 12, 2013 10:45 am

Hello,

What do you call as JUNK values?

How does the junk values come into the file..
Thanks,
Chandu

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others