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
 

 

Need the sort card using Build option.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
mfchnuser

New User


Joined: 21 Sep 2012
Posts: 12
Location: India

PostPosted: Mon Dec 10, 2012 5:29 pm    Post subject: Need the sort card using Build option.
Reply with quote

Hi

I have a file which has the record in this order in FILE A

Incident number(10) Ind1(1) Ind2(1)

the possible values of Ind 1 and Ind 2 are P,G and A,B respectively

eg-
Code:
0000000091 P A
0000000091 G A
0000000072 P B
0000000051 G B


I have another file, FILE B that has the Incident number field at 20 pos

My requirement is that I want to check FILE A for the incident number and possible combination 'P A' ,'G A','P B' and 'G B'.

I need omit sort cards in such a way so that- for eg

it checks for 'P A' and all incident no.
it checks for 'P B' and all incident no.
it checks for 'G A' and all incident no.
it checks for 'G B' and all incident no.

so i need 4 omit sort cards for all this,

for the incident numbers alone i had this sort card

Code:
//SYSIN DD *                                                   
  OPTION COPY                                                 
  OUTFIL REMOVECC,                                             
      HEADER1=('  SORT FIELDS=COPY ',/,                       
        '  OMIT COND=(1,1,BI,NE,1,1,BI,OR,'),                 
      BUILD=(C'  20,10,CH,EQ,C''',1,10,C''',OR,',80:X),       
      TRAILER1=('  1,1,BI,NE,1,1,BI)')                         
/*


but i need the check for indicators also .Please help

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

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Mon Dec 10, 2012 5:40 pm    Post subject: Reply to: Need the sort card using Build option.
Reply with quote

Please note that your post has been Code'd to preserve the spacing.

Can you show sample data, RECFM and LRECL, for both input files, and expected output from that, with matches, not matches, whatever. I think you are better looking at JOINKEYS, but can't be certain until we see what you want.
Back to top
View user's profile Send private message
mfchnuser

New User


Joined: 21 Sep 2012
Posts: 12
Location: India

PostPosted: Mon Dec 10, 2012 6:14 pm    Post subject: The details are as follows
Reply with quote

The requirement is as follows:

There are 3 files

FILE A( FB nad LRECL 80)
FILE B( FB nad LRECL 200)
FILE C( FB nad LRECL 200)

File A contents are -

0000000091 P A
0000000091 G A
0000000072 P B
0000000051 G B

these are the meanings of indicators-

A and B indicate whether record need to be omitted from FILE B or FILE C

P-(type 1 incident),G(Type 2 incident) so P and G are types of incidents

if an incident no. is given with a P in file 1 , then the incident number is at pos 20 in FILEB or FILEC

if an incident no. is given with a G in file 1 , then the incident number is at pos 40 in FILEB or FILE C

So, based on these indicators i need omit sort condition to delete records from the 2 files FILE B and FILE C

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

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon Dec 10, 2012 6:22 pm    Post subject:
Reply with quote

Quote:
A and B indicate whether record need to be omitted from FILE B or FILE C


Are the A records only in FileB and B records only in FileC or can they be in both? You need to be precise in giving your requirements.

Garry.
Back to top
View user's profile Send private message
mfchnuser

New User


Joined: 21 Sep 2012
Posts: 12
Location: India

PostPosted: Mon Dec 10, 2012 6:27 pm    Post subject: apologies for confusion
Reply with quote

A and B simply indicate whether records for a particular incident number needs to be deleted from FILE B or FILE C

both FILE B and FILE C have exactly same records initially.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Dec 10, 2012 8:20 pm    Post subject:
Reply with quote

Hello,

You need to post both of the input files sample data and the output you want from that sample data. Make the samples comprehensive.

USE the Code tag for readability. Use the Preview to see how your post will apear to the forum.

Completely / clearly re-post your "rules".
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Dec 10, 2012 10:34 pm    Post subject:
Reply with quote

mfchnuser,

What is the final output? Records from both FILEB and FILEC after the elimination into a single file? or do they need to be split accordingly ?

Run the following job and show us the complete sysout which helps us to determine the level of DFSORT your system has
Code:

//STEP0100 EXEC PGM=SORT 
//SYSOUT   DD SYSOUT=*   
//SORTIN   DD *           
ABC           
//SORTOUT  DD SYSOUT=*   
//SYSIN    DD *           
  SORT FIELDS=COPY       
//*     
Back to top
View user's profile Send private message
mfchnuser

New User


Joined: 21 Sep 2012
Posts: 12
Location: India

PostPosted: Tue Dec 11, 2012 4:54 pm    Post subject: Reply to: Need the sort card using Build option.
Reply with quote

ran the job you gave earlier

the sysout is as follows:

Code:
 SYNCSORT LICENSED FOR CPU SERIAL NUMBER 55BA6, MODEL 2817 708           
 SYSIN :                                                                 
   SORT FIELDS=COPY                                                     
 WER276B  SYSDIAG= 7613154, 12987187, 12987187, 8178825                 
 WER164B  6,896K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,     
 WER164B     0 BYTES RESERVE REQUESTED, 440K BYTES USED                 
 WER146B  20K BYTES OF EMERGENCY SPACE ALLOCATED                         
 WER108I  SORTIN   : RECFM=FB   ; LRECL=    80; BLKSIZE=    80           
 WER073I  SORTIN   : DSNAME=Z1225DJ.F0091CVT.JOB00968.D0000101.?         
 WER110I  SORTOUT  : RECFM=FB   ; LRECL=    80; BLKSIZE=    80           
 WER074I  SORTOUT  : DSNAME=Z1225DJ.F0091CVT.JOB00968.D0000104.?         
 WER410B  5,868K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
 WER410B     0 BYTES RESERVE REQUESTED, 324K BYTES USED                 
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                           
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                           
 WER416B  BSAM WAS USED FOR SORTIN                                       
 WER416B  BSAM WAS USED FOR SORTOUT                                     
WER054I  RCD IN          1, OUT          1                                     
WER169I  RELEASE 1.4 BATCH 0520 TPF LEVEL 0.1                                 
WER052I  END SYNCSORT - F0091CVT,STEP0100,,DIAG=AC00,6242,8084,00CC,E47A,48CB,8688,8460


The requirement is as follows, to make it simpler i have used id that resembles to file name:

There are 3 files

FILE A( FB nad LRECL 80)
FILE B( FB nad LRECL 200)
FILE C( FB nad LRECL 200)

FILE A CONTENTS

Code:
0000000091 P B
0000000095 G B
0000000072 P C
0000000051 G C

these are the meanings of indicators-

A and B indicate whether record need to be omitted from FILE B or FILE C

P-(type 1 incident),G(Type 2 incident) so P and G are types of incidents

if an incident no. is given with a P in file 1 , then the incident number is at pos 20 in FILEB or FILEC

if an incident no. is given with a G in file 1 , then the incident number is at pos 40 in FILEB or FILE C

So, based on these indicators i need omit sort condition to delete records from the 2 files FILE B and FILE C

Now example:

consider the contents are as follows:

FILE B CONTENTS
Code:
----+----1----+----2----+----3----+----4----+----5


123456789123456789AA00000000A1AAAAAAAAA0000000095
123456789123456789AA0000000021AAAAAAAAA0000000051
123456789123456789AA0000000091AAAAAAAAA0000000004
123456789123456789AA0000000072AAAAAAAAA0000000001


FILE C CONTENTS
Code:
----+----1----+----2----+----3----+----4----+----5


123456789123456789AA00000000A1AAAAAAAAA0000000095
123456789123456789AA0000000021AAAAAAAAA0000000051
123456789123456789AA0000000091AAAAAAAAA0000000004
123456789123456789AA0000000072AAAAAAAAA0000000001

now since file A has the following contents

FILE A CONTENTS
Code:
----+----1----+----2----+----3----+----4----+----5


0000000091 P B
0000000095 G B
0000000072 P C
0000000051 G C

in the first record for the incident no. '0000000091' the indicator at 12 pos is P and at 14 pos is B
means that record needs to be deleted from file B and the incident no. will be at pos 20 in FILE B(indicated by 'P' in FILE A)

same way for 2nd record ithe incident no. '0000000095' the indicator at 12 pos is G and at 14 pos is B
means that record needs to be deleted from file B and the incident no. will be at pos 40 in FILE B(indicated by 'G' in FILE A)

same way for 3rd record ithe incident no. '0000000072' the indicator at 12 pos is P and at 14 pos is C
means that record needs to be deleted from file C and the incident no. will be at pos 20 in FILE C(indicated by 'P' in FILE A)

same way for 4th record ithe incident no. '0000000051' the indicator at 12 pos is G and at 14 pos is c
means that record needs to be deleted from file C and the incident no. will be at pos 40 in FILE C(indicated by 'G' in FILE A)
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue Dec 11, 2012 5:16 pm    Post subject: Reply to: Need the sort card using Build option.
Reply with quote

WER messages mean you have SynsSort, so posted in the wrong forum. SyncSort questions go in JCL.

Kolusu is a DFSORT developer. SyncSort is a competitor product, and you have now wasted Kolusu's time.

Please ensure you don't post in the wrong forum again.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Dec 11, 2012 5:21 pm    Post subject:
Reply with quote

Your output shows you are using SYNCSORT, not DFSORT. You have posted in the wrong forum - you should be in the JCL forum which is for both JCL and SYNCSORT.

Also, you have now changed from using A and B indicators to B and C indicators and these now appear to indicate from which of the files the records are to be removed. I asked for clarification on this yesterday but your response to that request did not clarify.

Garry.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue Dec 11, 2012 7:01 pm    Post subject:
Reply with quote

I think as though you are over complicating this with Files B and C and the 'delete from' approach.

Try to redefine your requirements with just two input files 1 and 2 (since B and C are the same anyway).

You can then use a combination of Cond and Joinkeys (with unpaired 2) to select the ones you want from file 2 to go to output file 1 and the ones you want to go output file 2.

This positive logic is much easier for the human mind to process (at least my mind).
Back to top
View user's profile Send private message
mfchnuser

New User


Joined: 21 Sep 2012
Posts: 12
Location: India

PostPosted: Wed Dec 12, 2012 4:56 pm    Post subject: reply:
Reply with quote

Gary, sorry for posting this in DFSORT , i will repost in syncsort, i made indicators as B and C to make it sound easy , so that indicators match the file name

daveporcelan, these files B and C are not completely same, however many records are same. the records which i need to delete using sort card will exist in both files but that does not mean files are same. I just gave sample data as asked
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed Dec 12, 2012 5:34 pm    Post subject: Re: reply:
Reply with quote

mfchnuser wrote:
Gary, sorry for posting this in DFSORT , i will repost in syncsort


Please don't do that. I've already moved the topic to the JCL forum, which is where SyncSort questions are dealt with.
Back to top
View user's profile Send private message
mfchnuser

New User


Joined: 21 Sep 2012
Posts: 12
Location: India

PostPosted: Wed Dec 12, 2012 6:01 pm    Post subject: Thanks
Reply with quote

Thanks Bill for moving this to correct forum, It would be great if someoe can help me with this.

Thanks in advance
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed Dec 12, 2012 6:03 pm    Post subject: Reply to: Need the sort card using Build option.
Reply with quote

Can you show the input and output files for the code that you were given, please?
Back to top
View user's profile Send private message
mfchnuser

New User


Joined: 21 Sep 2012
Posts: 12
Location: India

PostPosted: Wed Dec 12, 2012 6:36 pm    Post subject: REPLY:
Reply with quote

Input files:

FILE A

Code:
0000000091 P B
0000000095 G B
0000000072 P C
0000000051 G C


FILE B
Code:

123456789123456789AA0000000051AAAAAAAAA0000000095
123456789123456789AA0000000021AAAAAAAAA0000000051
123456789123456789AA0000000091AAAAAAAAA0000000004
123456789123456789AA0000000072AAAAAAAAA0000000001
123456789123456789AA0000000015AAAAAAAAA0000000004
123456789123456789AA0000000023AAAAAAAAA0000000004
123456789123456789AA0000000045BBBBAAAAA0000000005
123456789123456789AA0000000032AAAAAAAAA0000000008


FILE C

Code:
123456789123456789AA0000000051AAAAAAAAA0000000095
123456789123456789AA0000000021AAAAAAAAA0000000051
123456789123456789AA0000000091AAAAAAAAA0000000004
123456789123456789AA0000000072AAAAAAAAA0000000001
123456789123456789AA0000000015AAAAAAAAA0000000004
123456789123456789AA0000000023AAAAAAAAA0000000004
123456789123456789AA0000000045BBBBAAAAA0000000005
123456789123456789AA0000000032AAAAAAAAA0000000008
123456789123456789AA0000000032AAAAAAAAA0000000045
123456789123456789AA0000000032AAAAAAAAA0000000176
123456789123456789AA0000000032AAAAAAAAA0000000668
123456789123456789AA0000000032AAAAAAAAA0000000678
123456789123456789AA0000000032AAAAAAAAA0000000488


after sort card execution, as per conditions given in FILE A
, the output in FILEB and FILE C are expected as


FILE B

Code:
123456789123456789AA0000000021AAAAAAAAA0000000051
123456789123456789AA0000000072AAAAAAAAA0000000001
123456789123456789AA0000000015AAAAAAAAA0000000004
123456789123456789AA0000000023AAAAAAAAA0000000004
123456789123456789AA0000000045BBBBAAAAA0000000005
123456789123456789AA0000000032AAAAAAAAA0000000008


FILE C

Code:
123456789123456789AA0000000051AAAAAAAAA0000000095
123456789123456789AA0000000091AAAAAAAAA0000000004
123456789123456789AA0000000015AAAAAAAAA0000000004
123456789123456789AA0000000023AAAAAAAAA0000000004
123456789123456789AA0000000045BBBBAAAAA0000000005
123456789123456789AA0000000032AAAAAAAAA0000000008
123456789123456789AA0000000032AAAAAAAAA0000000045
123456789123456789AA0000000032AAAAAAAAA0000000176
123456789123456789AA0000000032AAAAAAAAA0000000668
123456789123456789AA0000000032AAAAAAAAA0000000678
123456789123456789AA0000000032AAAAAAAAA0000000488
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Wed Dec 12, 2012 7:10 pm    Post subject:
Reply with quote

How many records are in each of these files?

The reason I ask is that an alternate approach (Rexx maybe) may be in order.

From my observation, a multiple pass Syncsort solution would be required.

You would need at least one step to Joinkeys on A and B and and another to Joinkeys A and C. There may even be two for each because the key in B and C varies based on the P/G value in A.

Not an easy one is it?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed Dec 12, 2012 7:39 pm    Post subject: Reply to: Need the sort card using Build option.
Reply with quote

Code:
  OMIT COND=((12,1,CH,EQ,C'P',
              AND,(20,10,CH,EQ,C'your number'),
            OR,
             (12,1,CH,EQ,C'G',
              AND,(40,10,CH,EQ,C'your number')))


I have not run the above, but it should be close.

Something like that. Then you'll need to generate one of those (like your existing example) for each of the files.

You realise you will not be deleting records from the actual B and C files, but creating copies without those records on?
Back to top
View user's profile Send private message
mfchnuser

New User


Joined: 21 Sep 2012
Posts: 12
Location: India

PostPosted: Wed Dec 12, 2012 7:57 pm    Post subject: reply:
Reply with quote

Hi daveporcelan

The number of records vary from day to day load..it might go upto 50 k.

Rexx cant be used as this step has to be added as part of existing JCL.

Bill, since this will be a dynamic sort card since the FILE A contents will change daily. I was looking for what can be given using build statement
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Wed Dec 12, 2012 8:09 pm    Post subject:
Reply with quote

Quote:
Rexx cant be used as this step has to be added as part of existing JCL.



A 'Step' can be added to the existing JCL invoking a Rexx Exec to perform the processing.

That is how I would do this complex of a requirement. That is just me. 50k records would process in a short amount of time.

You would need several Sort steps to accomplish your goals.
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 -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

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 convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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