Eliminate Header and Trailer



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Eliminate Header and Trailer

Postby gyt3 » Sun Dec 16, 2012 10:07 am

MY input file looks like this
hdr^123?^11asgg^
a^fsg^slsndd^gsg^fsdgs^
d^fgn^glkl^gdfngl^gdkgd^
m^fgfnd^sgndflghkldgh^sdnglfh^
trl^ngdfldkhkdglh^gfkgjdf^

I want to handle these records using Unstring function in COBOL, but i want to eliminate the records starting with "hdr" and "trl".
How is it possible ? Can anyone help me out in this?
gyt3
 
Posts: 16
Joined: Sun Dec 16, 2012 9:58 am
Has thanked: 3 times
Been thanked: 0 time

Re: Eliminate Header and Trailer

Postby BillyBoyo » Sun Dec 16, 2012 1:57 pm

Define/REDEFINE the first three bytes of your record-area. Put a condition-name/88 on that field, specifying 'hdr' and 'trl' in the VALUE clause. Test for the condition-name and don't do the processing if true.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Eliminate Header and Trailer

Postby gyt3 » Sun Dec 16, 2012 7:15 pm

Thanks a lot ...
gyt3
 
Posts: 16
Joined: Sun Dec 16, 2012 9:58 am
Has thanked: 3 times
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post