View previous topic :: View next topic
|
Author |
Message |
Parthasarathy
New User
Joined: 24 Feb 2006 Posts: 18 Location: Chennai
|
|
|
|
Hi,
I have 2 files. One is a control file with only one record and other is a master file with many records. Both have recl 80 and FB.
If the control file has Low values in first 10 bytes, i should not copy the master file to output. If it is not low values, then i should copy the master file to output file.
Is it possible to do using a sort/icetool step? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
By low values, do you mean binary zeros (X'00...00') or something else?
Do you want to avoid doing the copy at all if the control file has low values, or do you want to create an empty output data set?
Is RC=4 ok when the file is not copied? |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Hi Partha,
Messages you are getting in below thread are WER messages..
ibmmainframes.com/viewtopic.php?t=43100
Which tells you have SYNCSORT not DFSORT at your shop...
SYNCSORT related questions should be posted in JCL forum.. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Sambhaji,
The link which you have posted above leads to a topic in which "Parthasarathy", the OP of this topic is nowhere in the picture.
I could see only 'sprasannapathy' . |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Arun wrote: |
The link which you have posted above leads to a topic in which "Parthasarathy", the OP of this topic is nowhere in the picture.
I could see only 'sprasannapathy' .
|
My fatty eyes.. |
|
Back to top |
|
|
Parthasarathy
New User
Joined: 24 Feb 2006 Posts: 18 Location: Chennai
|
|
|
|
Thanks for your reply Frank,
Frank Yaeger wrote: |
By low values, do you mean binary zeros (X'00...00') or something else? |
You are correct. It is binary zeros only.
Frank Yaeger wrote: |
Do you want to avoid doing the copy at all if the control file has low values, or do you want to create an empty output data set? |
I want to create an empty output dataset.
Frank Yaeger wrote: |
Is RC=4 ok when the file is not copied? |
I need RC=0
Sambhaji, My shop is using DFSORT only |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Hi Partha,
Below step will give you desired result. I have assumed that second file doesn't have binary zeros(X'00') at first 10 bytes.
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTMSG DD SYSOUT=*
//SORTIN DD ctrl file
// DD data file
//SORTOUT DD output file
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(1,80,SEQNUM,8,ZD)),
IFTHEN=(WHEN=GROUP,BEGIN=(1,10,CH,EQ,X'00000000000000000000'),
PUSH=(89:ID=1))
OUTFIL BUILD=(1,80),INCLUDE=(89,1,ZD,NE,1,AND,81,8,ZD,NE,1)
/*
|
|
|
Back to top |
|
|
Parthasarathy
New User
Joined: 24 Feb 2006 Posts: 18 Location: Chennai
|
|
|
|
Thanks a lot Sambhaji.
Unfortunately, my requirement got changed that my control file will have either 1 one record with values as binary zeros or more than one record with character values. the key remains same as 10 bytes in the control file. There will be no binary zeros in the other input file as you have rightly assumed.
It will be really helpful if you can provide me a solution for this. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Partha,
You can use a DFSORT/ICETOOL job like the following to do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... control file
//IN2 DD DSN=... input file
//CTL2CNTL DD DSN=&&C2,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//OUT DD DSN=... output file
//TOOLIN DD *
COPY FROM(IN1) TO(CTL2CNTL) USING(CTL1)
COPY FROM(IN2) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
INREC IFOUTLEN=80,
IFTHEN=(WHEN=(1,10,BI,EQ,X'00000000000000000000'),
BUILD=(C' OMIT COND=ALL'))
/*
|
|
|
Back to top |
|
|
Parthasarathy
New User
Joined: 24 Feb 2006 Posts: 18 Location: Chennai
|
|
|
|
Hi Frank,
I expected that the solution might be bit complex.
But your solution looks very simple.
Many thanks for the simple solution. Thanks to all |
|
Back to top |
|
|
|