View previous topic :: View next topic
|
Author |
Message |
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
OMIT COND=(85,maxlrecl-84,SS,EQ,C' ') |
Why have you made up some syntax of your own. . .
One way to do what you want might be to specify the maximum length of any record and allow for short records. . . Read about VLTEST in your manual or search in this JCL part of the forum. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Check in the documentation the meaning of SS in:
Code: |
OMIT COND=(20,30,SS,EQ,C'|') |
Edit: again and again, i forgot to check page 2 and i'm late !! |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Priyanka Pyne,
The below Syncsort job does what you're trying to achieve. Note that I have used VLTESTI=2 so that Syncsort does the comparison against the fields available instead of failing the comparison for short records.
Code: |
//STEP01 EXEC PGM=SORT,PARM='VLTESTI=2'
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN= Input file (VBA/32756)
//SORTOUT DD DSN= Output file (VBA/32756)
//SYSIN DD *
OPTION COPY
OMIT COND=(6,1,CH,NE,C' ',OR,
6,5,CH,EQ,C'PRINT',OR,
6,2,CH,EQ,C'$$',OR,
6,32750,SS,EQ,C'||',OR,
1,2,BI,EQ,5) |
SORTIN
Code: |
1IBM File Manager for z/OS
0
-
0FMNBA001 IBM File Manager for z/OS Version 11 Release 1
0FMNBA010 Not APF authorized
0FMNBA010 Service Levels of installed components
0FMNBA010 Base IMS DB2 CICS
0FMNBA010 English UK66921 UK66925 UK66923 UK66274
New data set fields: NAME SURNAME
ID NREC-# OREC-# <---+---> <---+--->
I 000001 abcd klgjk
I 000003 hhjh jlkjlj
Old data set fields: NAME SURNAME
ID NREC-# OREC-# <---+---> <---+--->
D 000002 aaaaa bbbb
C 000004 fffffff yyyy
O 000003 sgg lllll
|||||
|||||
||||| |
SORTOUT
Code: |
New data set fields: NAME SURNAME
ID NREC-# OREC-# <---+---> <---+--->
I 000001 abcd klgjk
I 000003 hhjh jlkjlj
Old data set fields: NAME SURNAME
ID NREC-# OREC-# <---+---> <---+--->
D 000002 aaaaa bbbb
C 000004 fffffff yyyy
O 000003 sgg lllll |
|
|
Back to top |
|
|
Priyanka Pyne
New User
Joined: 09 Feb 2008 Posts: 95 Location: India
|
|
|
|
Hi Arun,
I tried with your code snippet. I need '|' in my output file so I slightly changed your sort card. But my out put is totally different from yours.
Input File:
Code: |
1IBM File Manager for z/OS
0
-
0FMNBA001 IBM File Manager for z/OS Version 11 Release 1
0FMNBA010 Not APF authorized
0FMNBA010 Service Levels of installed components
0FMNBA010 Base IMS DB2 CICS
0FMNBA010 English UK66921 UK66925 UK66923 UK66274
0DEFAULT SET FUNCTION VALUES:
PRINTOUT=SYSPRINT HEADERPG=YES ASCII=NO RECLIMIT=(1,*)
PRINTLEN=132 PAGESKIP=NO PAD=OFF MSGUPPER=NO
PAGESIZE=60 DATAHDR=YES PRTCLASS=A LANGUAGE=ENGLISH
PRTTRANS=ON DUMP=UPDOWN TAPELBL=SL CYLHD=ABSOLUTE
SMFNO=000 PRTDISP=MOD USEIOX=DISABLE IOX=
TEMP UNIT=SYSALLDA DATA= STOR= MANAGEMENT=
PERM UNIT=SYSALLDA DATA= STOR= MANAGEMENT=
TRACECLS=A
1IBM File Manager for z/OS
0$$FILEM DSCMP TYPE=FORMATTED,
$$FILEM PACK=UNPACK,
$$FILEM SYNCH=KEYED,
$$FILEM KEYLOCOLD=1,
$$FILEM KEYLOCNEW=1,
$$FILEM KEYLEN=6,
$$FILEM KEYTYPE=CHAR,
$$FILEM LIST=LONG,
$$FILEM WIDE=YES,
$$FILEM HILIGHT=YES,
$$FILEM CHNGDFLD=YES,
$$FILEM IGNLEN=YES,
$$FILEM EXCLUDE=(,,MATCHED,),
$$FILEM NUMDIFF=ALL,
$$FILEM DSNOLD=xxxxx.TEST.VSAM.FILE1,
$$FILEM TCOLD=DEB.xxxxx.LCS.JOBLIB2(VSAM),
$$FILEM LANG=COBOL,
$$FILEM SKIPOLD=0,
$$FILEM CMPOLD=ALL,
$$FILEM TCNEW=DEB.xxxxx.LCS.JOBLIB2(VSAM),
$$FILEM SKIPNEW=0,
$$FILEM CMPNEW=ALL,
$$FILEM DSNNEW=xxxxx.TEST.VSAM.FILE2
1IBM File Manager for z/OS
0* * * * Formatted comparison with keyed synchronization
* * New data set: xxxxx.TEST.VSAM.FILE2
* * using copybook DEB.xxxxx.LCS.JOBLIB2(VSAM)
* * Old data set: xxxxx.TEST.VSAM.FILE1
* * using copybook DEB.xxxxx.LCS.JOBLIB2(VSAM)
* * Output data sets:
* * Inserted: ORD.xxxxx.TEST.INSERTED.T
* * Deleted: ORD.xxxxx.TEST.DELETED.T
* * New Changed: ORD.xxxxx.TEST.CHANGED.T
New data set fields: NAME SURNAME
ID NREC-# OREC-# <---+---> <---+--->
I 000001 mmmmmmm nnnn
I 000003 rrrrr ggggg
Old data set fields: NAME SURNAME
ID NREC-# OREC-# <---+---> <---+--->
D 000002 ddddd ggggg
C 000004 sssssss ggggg
O 000003 sssssss ppp
|||||
1IBM File Manager for z/OS
0Comparison summary:
Old data set records processed: 3
New data set records processed: 4
Matching records found: 1
Changed records: 1
Old records not selected: 0
New records not selected: 0
Old records not compared: 0
New records not compared: 0
Old data set records deleted: 1
New data set records inserted: 2
Output data set records written:
Inserted: 2
Deleted: 1
New Changed: 1
Synchronization: Keyed 1 1 6 AN
Comparison type: Formatted
Listing type: Long
Listing exclusions: Matched
Listing options: Wide listing
Highlight changes
Show changed fields only
Template reporting options:
0FMNBA709 Compare sets don't match |
Output:
Code: |
0
-
|||||
Old data set records processed: 3
New data set records processed: 4
Matching records found: 1
Changed records: 1
Old records not selected: 0
New records not selected: 0
Old records not compared: 0
Old data set records deleted: 1
New data set records inserted: 2
Output data set records written:
Inserted: 2
Deleted: 1
New Changed: 1
Synchronization: Keyed 1 1 6 AN
Comparison type: Formatted
Listing type: Long
Listing exclusions: Matched
Listing options: Wide listing
Highlight changes
Show changed fields only
Template reporting options: |
My sort Card:
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OMIT COND=(6,1,CH,NE,C' ',OR,
6,5,CH,EQ,C'PRINT',OR,
6,2,CH,EQ,C'$$',OR,
1,2,BI,EQ,5)
/* |
[/code]
It seems it has removed all my comparison result. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
It looks to me that Arun has taken your data from your first post and given you OMIT conditions to give you the output you wanted.
You have since changed the format of the data.
is getting rid of most of the stuff that you want, because it now starts in column six, instead of later as in your original. |
|
Back to top |
|
|
Priyanka Pyne
New User
Joined: 09 Feb 2008 Posts: 95 Location: India
|
|
|
|
Yes Bill. You are absolutely right. I want exactly what Arun has mentioned in his output. The only change thing thats need to be modified is, I want '|' as well in my output file. I am totally pissed off with this.
Someone please help. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
But your input is not the same as your original input. Data that you want is now lined-up with data that you don't want. So when you do the exclude as from the original sample data, you loose all the "ID" and "I" stuff etc.
Can you get the line-up back to your original example? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
I am totally pissed off with this |
how do you think everybody feels about you? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I am totally pissed off with this. |
Understandable as you are just flailing away. . .
Suggest you consider how you would get what you want writing actual code and then implement same in sort control statements.
Your control statements need to be specific rather than just some collection of positions and values. . . No one here should fiddle with code that does not even follow the processing rules. |
|
Back to top |
|
|
Priyanka Pyne
New User
Joined: 09 Feb 2008 Posts: 95 Location: India
|
|
|
|
This is my output.
Code: |
New data set fields: NAME SURNAME
ID NREC-# OREC-# <---+---> <---+--->
I 000001 mmmmmmm nnnn
I 000003 rrrrr ggggg
Old data set fields: NAME SURNAME
ID NREC-# OREC-# <---+---> <---+--->
D 000002 ddddd ggggg
C 000004 sssssss ggggg
O 000003 sssssss ppp
|||||
|
Just help me to remove the lines with spaces. And the o/p is a VB file. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
dare I ask?
what does the current input look like?
what do your control statements look like?
to simply remove lines with spaces, omit 10,30,ch,eq,30C' ' |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
The only change thing thats need to be modified is, I want '|' as well in my output file. |
Is there some reason you did not post the modified sort control and jcl. . .
Quote: |
But my out put is totally different from yours. |
When you change the code, expect different output. . .
As you have changed things multiple times, suggest you re-post the current input data, the current jcl/sort control, and the current output if you have not determined why you do not get the desired output. By continuing to flail about, this topic is now into 3 pages - 2 of which are not really needed.
If this ever gets resolved, i'll try to clean up the unneeded posts. . . |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Priyanka Pyne wrote: |
This is my output.
Code: |
New data set fields: NAME SURNAME
ID NREC-# OREC-# <---+---> <---+--->
I 000001 mmmmmmm nnnn
I 000003 rrrrr ggggg
Old data set fields: NAME SURNAME
ID NREC-# OREC-# <---+---> <---+--->
D 000002 ddddd ggggg
C 000004 sssssss ggggg
O 000003 sssssss ppp
|||||
|
Just help me to remove the lines with spaces. And the o/p is a VB file. |
The column where the first pipe is has a non-blank in every line you want. If you exclude blanks in that column, you should get the output - remembering the VLTESTI for the short lines. Might keep it simpler having got this output to do a second pass just for the blanks as a "get the damn thing out of the way" if you don't get it with the OMIT all together. |
|
Back to top |
|
|
Priyanka Pyne
New User
Joined: 09 Feb 2008 Posts: 95 Location: India
|
|
|
|
Hi Dick,
I have re-posted my requirement to avoid confusion. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please post ALL that was requested. . . You posted 1 of 3. . .
Best to have the input, the jcl/code, and the unwanted output with an explanaton all in the same post. . . |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you post another duplicate topic, it will be deleted. One more after that, and you'll likely be banned. . .
The most recent no-value duplicte has already been deleted. . .
d |
|
Back to top |
|
|
Priyanka Pyne
New User
Joined: 09 Feb 2008 Posts: 95 Location: India
|
|
|
|
I am sorry Dick. I posted a fresh topic but it has been deleted.
Please let me know if I can go ahead and repost or if I can continue here. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
When you change the code, expect different output |
Hi Dick,
Change in the input data format did most of the damage. The solution provided was as per what had been told so far by the OP. And the requirements have been contradictory as well. Initially '||" was not needed and all of a sudden it is needed.
As Bill has pointed earlier in this thread, the data required is tied to the data not required now. Other than 'PRINT', there seems to be so many other strings which are to be checked if we follow the OP's data omission rules.
Code: |
PRINTOUT=SYSPRINT HEADERPG=YES ASCII=NO RECLIMIT=(1,*)
PRINTLEN=132 PAGESKIP=NO PAD=OFF MSGUPPER=NO
PAGESIZE=60 DATAHDR=YES PRTCLASS=A LANGUAGE=ENGLISH
PRTTRANS=ON DUMP=UPDOWN TAPELBL=SL CYLHD=ABSOLUTE
SMFNO=000 PRTDISP=MOD USEIOX=DISABLE IOX= |
Let's hope that the TS comes up with a better explanation of his/her requirement. |
|
Back to top |
|
|
kalyan.v
New User
Joined: 04 Feb 2008 Posts: 65 Location: Hyd
|
|
|
|
Priyanka,
i dont know whether you have found out the answer for your requirement.
but my idea is there is an option called SUBSTRING
use this condition and run your JCL it will work.
SORT FIELDS=COPY
INCLUDE COND=(1,50,SS,NE,C'||')
FYI...i considered the file as FB and lrecl is 50 bytes.
in case of VB the values differ.
please let me know if you have any questions,
thanks,
Ravi. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Code: |
SORT FIELDS=COPY
INCLUDE COND=(1,50,SS,NE,C'||') |
Has this been tested to see if it meets the complete requirement? I'm fairly certain that it does not. . . |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
39 post and getting nowhere |
|
Back to top |
|
|
Priyanka Pyne
New User
Joined: 09 Feb 2008 Posts: 95 Location: India
|
|
|
|
Hello Dick,
As you said, I also had an impression that its not going to help me and that was true. I tried but it didn't help. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I suspect that somewhere in your job description is "write program code".
Maybe it is time to write a bit and be done with this. . . |
|
Back to top |
|
|
|