MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Flagging particular records in a sequential file
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Thu May 25, 2006 8:00 am    Post subject: Flagging particular records in a sequential file Reply with quote

Flagging particular records in a sequential file
I have a file with data as follows

Quote:

20060524405A551117386.054009780432805400
20060524405A551117386.054009780532905400 AAA
20060524405A551117386.054009780667805400
200605240540097963724.054009796372405400
200605240540098383887.054009838388705400


Here the Bold ones are the main accounts and the sub-accounts are the ones next to main account.
you can see the AAA in the second record which is the flag.I have to flag all the main accounts if any of the sub-accounts is flagged i.e the output should appear like this,

Quote:

20060524405A551117386.054009780432805400 AAA
20060524405A551117386.054009780532905400 AAA
20060524405A551117386.054009780667805400 AAA
200605240540097963724.054009796372405400
200605240540098383887.054009838388705400



Any Help!!

Thanks,
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu May 25, 2006 8:19 am    Post subject: Reply with quote

vak255,

The following DFSORT/ICETOOL JCl will give you the desired results. You need to have z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) installed which support KEEPBASE option on SPLICE. KEEPBASE can be used to keep the base records (first duplicate) as well as the spliced records.

Code:

//STEP0100 EXEC PGM=ICETOOL                                 
//DFSMSG   DD SYSOUT=*                                     
//TOOLMSG  DD SYSOUT=*                                     
//IN       DD *                                             
20060524405A551117386.054009780432805400                   
20060524405A551117386.054009780532905400 AAA               
20060524405A551117386.054009780667805400                   
200605240540097963724.054009796372405400                   
200605240540098383887.054009838388705400                   
//OUT      DD SYSOUT=*                                     
//TOOLIN   DD *                                             
  SPLICE FROM(IN) TO(OUT) ON(09,13,CH) WITH(1,41) WITHALL -
  KEEPBASE KEEPNODUPS USING(CTL1)                           
//CTL1CNTL DD *                                             
  SORT FIELDS=(09,13,CH,A,42,3,CH,D)                         
/*


The output of this job is
Code:

200605240540097963724.054009796372405400   
200605240540098383887.054009838388705400   
20060524405A551117386.054009780532905400 AAA
20060524405A551117386.054009780432805400 AAA
20060524405A551117386.054009780667805400 AAA


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Thu May 25, 2006 8:35 am    Post subject: Reply with quote

Thanks kolusu, If this is available in our shop,I will try this and will let you know.
This file is already sorted , so I don't want to sort it.

Thanks a lot Buddy.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu May 25, 2006 8:45 am    Post subject: Reply with quote

Quote:

This file is already sorted , so I don't want to sort it.


The input you have shown is NOT sorted on the main accounts on the ascending sequence.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Thu May 25, 2006 8:49 am    Post subject: Reply with quote

Sorry Klusu, I thought it was sorted.I wil check that....


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


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri May 26, 2006 6:09 am    Post subject: Reply with quote

THANKS kolusu, Your JCL is working Great. But there is a small change.
Sorry I have NOT given you the whole record layout above, actually the data is sorted and it looks like below and it does't end with AAA there is some more data beyond that point.

Quote:

20060524405A551117386.054009780432805400 05400976351510540097635
20060524405A551117386.054009780532905400 AAA05400976805350540097680
20060524405A551117386.054009780667805400 05400978043280540097804
200605240540097963724.054009796372405400 05400978053290540097805
200605240540098383887.054009838388705400 05400978066780540097806



I have changed the JCL like below, please let me know if anything is wrong.
Code:

//STEP0100 EXEC PGM=ICETOOL                                 
//DFSMSG   DD SYSOUT=*                                     
//TOOLMSG  DD SYSOUT=*                                     
//IN       DD * 
20060524405A551117386.054009780432805400    05400976351510540097635
20060524405A551117386.054009780532905400 AAA05400976805350540097680
20060524405A551117386.054009780667805400    05400978043280540097804
200605240540097963724.054009796372405400    05400978053290540097805
200605240540098383887.054009838388705400    05400978066780540097806
//OUT      DD SYSOUT=*                                     
//TOOLIN   DD *                                             
  SPLICE FROM(IN) TO(OUT) ON(09,13,CH) WITH(1,41) WITH(45,67) WITHALL -
  KEEPBASE KEEPNODUPS USING(CTL1)                           
//CTL1CNTL DD *                                             
  SORT FIELDS=(09,13,CH,A,42,3,CH,D)                         
/*

As you can see the input is sorted from 45 postion with length 13. SO i HAVE INCLUDED THE WITH(45,67) I.E 67 is the length of record.pls let me know whether this is correct as I have no idea abt DFSORT.

I like the output file like
Code:

20060524405A551117386.054009780432805400 AAA05400976351510540097635
20060524405A551117386.054009780532905400 AAA05400976805350540097680
20060524405A551117386.054009780667805400 AAA05400978043280540097804
200605240540097963724.054009796372405400     05400978053290540097805
200605240540098383887.054009838388705400     05400978066780540097806
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri May 26, 2006 6:14 am    Post subject: Reply with quote

There was some problem with the spaces,
Input:
Code:

20060524405A551117386.054009780432805400 ---05400976351510540097635
20060524405A551117386.054009780532905400 AAA05400976805350540097680
20060524405A551117386.054009780667805400 ---05400978043280540097804
200605240540097963724.054009796372405400 ---05400978053290540097805
200605240540098383887.054009838388705400 ---05400978066780540097806



Required output:
Code:

20060524405A551117386.054009780432805400 AAA05400976351510540097635
20060524405A551117386.054009780532905400 AAA05400976805350540097680
20060524405A551117386.054009780667805400 AAA05400978043280540097804
200605240540097963724.054009796372405400 ---05400978053290540097805
200605240540098383887.054009838388705400 ---05400978066780540097806
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri May 26, 2006 7:24 am    Post subject: Reply with quote

vak255,

It would be really helpful if you put all the details at once. Most of the solutions provided here can be run on your machine with minimal changes if you post the correct requirements.

Also you say your file is sorted on the Account number starting at pos 9 for a length of 13 bytes, but in reality it is NOT sorted on the ascending sequence of the account number. If you really want to preserve the same sequence then you will need another pass of the data.

Here is the JCL which will give the desired results.

Code:

//STEP0100 EXEC PGM=ICETOOL                                       
//DFSMSG   DD SYSOUT=*                                             
//TOOLMSG  DD SYSOUT=*                                             
//IN       DD *                                                   
20060524405A551117386.054009780432805400    05400976351510540097635
20060524405A551117386.054009780532905400 AAA05400976805350540097680
20060524405A551117386.054009780667805400    05400978043280540097804
200605240540097963724.054009796372405400    05400978053290540097805
200605240540098383887.054009838388705400    05400978066780540097806
//OUT      DD SYSOUT=*                                             
//TOOLIN   DD *                                                   
  SPLICE FROM(IN) TO(OUT) ON(09,13,CH) WITH(1,41) WITH(45,23) -   
  WITHALL KEEPBASE KEEPNODUPS USING(CTL1)                         
//CTL1CNTL DD *                                                   
  SORT FIELDS=(09,13,CH,A,42,3,CH,D)                               
/*                                                                 




The output from the job is

Code:

200605240540097963724.054009796372405400    05400978053290540097805
200605240540098383887.054009838388705400    05400978066780540097806
20060524405A551117386.054009780532905400 AAA05400976805350540097680
20060524405A551117386.054009780432805400 AAA05400976351510540097635
20060524405A551117386.054009780667805400 AAA05400978043280540097804


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri May 26, 2006 7:53 am    Post subject: Reply with quote

Thanks for all the Help!!
Next time I will try to post with all details.
Back to top
View user's profile Send private message
ynbasha
Beginner


Joined: 09 May 2005
Posts: 1
Topics: 0
Location: pune

PostPosted: Fri May 26, 2006 9:24 am    Post subject: Reply with quote

hi kolusu,

It's working for FB records ,if the input file has RECFM=VB, how to achieve , even if i add 4 bytes to the corresponding fields it's throwing user abend
_________________
Noor Basha.
Pune.
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri May 26, 2006 9:46 am    Post subject: Reply with quote

Quote:

It's working for FB records ,if the input file has RECFM=VB, how to achieve , even if i add 4 bytes to the corresponding fields it's throwing user abend

ynbasha,

You need to post the error messages , so that we can help you

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon May 29, 2006 3:55 am    Post subject: Reply with quote

Ynbasha,

Remove DCB parameters from your OUPTUT file (if you have specified any) and then try again. Or use OUTFIL CONVERT.

Hope this helps,

Thanks,
Phantom
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Jun 21, 2006 12:10 am    Post subject: Flagging particular records in a sequential file - VB Reply with quote

I got a similar situation here.I got a VB file.

The input file looks like this. Below '---' are the spaces. I don't know why spaces are not displayed when I submitted, so I marked it with '---'

    Mhdr 20060606
    20060524405A551117386.0540097804 --- 05400976351510540097635
    20060524405A551117386.0540097805 LLL05400976805350540097680
    20060524405A551117386.0540097806 ccc05400978043280540097804
    20060524405A551117387.0540097801 --- 05400976805350540097680
    20060524405A551117387.0540097802 --- 05400978043280540097804
    Mhdr 20060606


The output file should be sorted on the Main Account numer " eg: 405A551117386".It starts at 9th positon with length 13.

The accounts following the main account is the sub-accout(0540097804).The header and trailer is required to be there in the output file.

If any of the sub-accounts under a main-acct are flagged with any error-code i.e 'LLL'/'ccc' (any charcters, We need to check for non-spaces) in position 982 with length of 3. then the spaces in position 982-984 in all the sub-accts under that main-acct shuld be marked with LLL.


The output required is:



Quote:

Mhdr 20060606
20060524405A551117386.0540097804 LLL05400976351510540097635
20060524405A551117386.0540097805 LLL05400976805350540097680
20060524405A551117386.0540097806 ccc05400978043280540097804
20060524405A551117387.0540097801 --- 05400976805350540097680
20060524405A551117387.0540097802 --- 05400978043280540097804
Mhdr 20060606



The main thing to note is if all the sub-acct under a main acct is not marked with any error-code then the spaces in 982-984 shuld be left as spaces.

I have decided to do the sorting thru JCL and to handle the flagging in the cobol program.

I like to know whether this can be handled in ICETOOL/DFSORT without using the cobol pgm.

Experts in ICETOOL/DFSORT , any suggestions will be great?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jun 21, 2006 5:38 am    Post subject: Reply with quote

vak255,

*Sigh* Post ALL the details. what is the LRECL and RECFM of the input file and desired output files?
Quote:

I have decided to do the sorting thru JCL and to handle the flagging in the cobol program.


Hmm I thought the solutions provided in this topic did solve everything with DFSORT

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Jun 21, 2006 7:35 am    Post subject: Reply with quote

Kolusu,


Here is the details
Dsorg: PS
Recfm= VB
Lrecl= 3004

Quote:

Hmm I thought the solutions provided in this topic did solve everything with DFSORT


But I don't see any DFSORT solution.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group