View previous topic :: View next topic |
Author |
Message |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Thu May 25, 2006 8:00 am Post subject: Flagging particular records in a sequential file |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu May 25, 2006 8:19 am Post subject: |
|
|
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 |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Thu May 25, 2006 8:35 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu May 25, 2006 8:45 am Post subject: |
|
|
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 |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Thu May 25, 2006 8:49 am Post subject: |
|
|
Sorry Klusu, I thought it was sorted.I wil check that....
Thanks again. |
|
Back to top |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Fri May 26, 2006 6:09 am Post subject: |
|
|
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 |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Fri May 26, 2006 6:14 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri May 26, 2006 7:24 am Post subject: |
|
|
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 |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Fri May 26, 2006 7:53 am Post subject: |
|
|
Thanks for all the Help!!
Next time I will try to post with all details. |
|
Back to top |
|
 |
ynbasha Beginner
Joined: 09 May 2005 Posts: 1 Topics: 0 Location: pune
|
Posted: Fri May 26, 2006 9:24 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri May 26, 2006 9:46 am Post subject: |
|
|
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 |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Mon May 29, 2006 3:55 am Post subject: |
|
|
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 |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Wed Jun 21, 2006 12:10 am Post subject: Flagging particular records in a sequential file - VB |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Jun 21, 2006 5:38 am Post subject: |
|
|
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 |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Wed Jun 21, 2006 7:35 am Post subject: |
|
|
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 |
|
 |
|
|