View previous topic :: View next topic
Author
Message
ap_mainframes Active User Joined: 29 Dec 2005Posts: 181 Location: Canada
Hi,
My input file is of length 80,FB.
Here is how it looks like
ROOT ..ACU00 ACU00ACUPUNCTURE
CHILD ..ACU00DABB DABBDC
CHILD ..ACU00DAB1 DAB1DC
CHILD ..ACU00DAB2 DAB2DC
ROOT1 ..12345 ACU00ACUPUNCTURE
CHILD1 ..ACU00DABB DABBDC
CHILD1 ..ACU00DAB1 DAB1DC
CHILD1 ..ACU00DAB2 DAB2DC
I want to check if
1. the value is ROOT ( highlighted in bold), and
2. the value in column 5 to 10, is numeric( highlighted in bold)
Then write the Root and all the CHILDs under it.
Like, with the above example,
My output file should have
ROOT1 ..12345 ACU00ACUPUNCTURE
CHILD1 ..ACU00DABB DABBDC
CHILD1 ..ACU00DAB1 DAB1DC
CHILD1 ..ACU00DAB2 DAB2DC
Can this be done in DFSORT ?
I think I have furnished all the information needed.
Thanks for all the help you can provide.
[/b]
Back to top
Skolusu Senior Member Joined: 07 Dec 2007Posts: 2205 Location: San Jose
ap_mainframes,
You can use DFSORT's new WHEN=GROUP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this to get the desired results
Code:
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ROOTACU00 ACU00ACUPUNCTURE
CHILD ..ACU00DABB DABBDC
CHILD ..ACU00DAB1 DAB1DC
CHILD ..ACU00DAB2 DAB2DC
ROOT12345 ACU00ACUPUNCTURE
CHILD1 ..ACU00DABB DABBDC
CHILD1 ..ACU00DAB1 DAB1DC
CHILD1 ..ACU00DAB2 DAB2DC
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=GROUP,
BEGIN=(1,4,CH,EQ,C'ROOT',AND,5,5,ZD,EQ,NUM),PUSH(81:ID=1))
OUTFIL INCLUDE=(81,1,ZD,GT,0),BUILD=(1,80)
/*
For complete details on the new WHEN=GROUP function and the other new functions available with PTF UK90013, see:
Use [URL] BBCode for External Links
Hope this helps...
Cheers
Back to top
ap_mainframes Active User Joined: 29 Dec 2005Posts: 181 Location: Canada
Skolusu,
Unfortunately, I am getting a syntax error. It appears that my shop doesnt have the latest version.
Any other possible solution ?
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
Please post the error message including the message id.
Back to top
ap_mainframes Active User Joined: 29 Dec 2005Posts: 181 Location: Canada
Dick,
Here is the error I am getting
SYSIN :
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=GROUP,
*
BEGIN=(23,4,CH,EQ,C'SCRT',AND,32,5,ZD,EQ,NUM),PUSH(116:ID=1))
OUTFIL INCLUDE=(116,1,ZD,GT,0),BUILD=(1,116)
WER161B ALTERNATE PARM USED
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Back to top
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
Hi,
WER messages means you are using SYNCSORT and not DFSORT.
Gerry
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
ap_mainframes,
NUM subparameter has been introduced in the latest version of Syncsort - Syncsort for z/OS Release 1.3. Which version do you have there?
Thanks,
Arun
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
I do not believe NUM is the issue. I believe AP wants to use the GROUP function, which is not in the newest release of Syncsort.
As they say - corrections are welcome
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
Hi Dick,
I was thinking if we can do the GROUPing in some way, the only hurdle left out is to check for numeric and it is available with the latest release of Syncsort.
ap_mainframes,
If you have Syncsort 1.3, you can try out the below SYNCTOOL job. I have not tested this as I dont have the latest Syncsort release.
Code:
//STEP1 EXEC PGM=SYNCTOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//IN DD DSN=Input-file -----> FB,LRECL=80
//OUT DD DSN=Output-file -----> FB,LRECL=80
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(89,8,CH) WITHALL WITH(1,80) -
KEEPBASE KEEPNODUPS USING(CTL1)
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(81:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(1,4,CH,EQ,C'ROOT'),
OVERLAY=(89:SEQNUM,8,ZD),HIT=NEXT),
IFTHEN=(WHEN=(1,4,CH,EQ,C'ROOT',AND,5,5,FS,EQ,NUM),
OVERLAY=(97:C'N')),
IFTHEN=(WHEN=NONE,
OVERLAY=(89:SEQNUM,8,ZD,89:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))
OUTFIL INCLUDE=(97,1,CH,EQ,C'N'),BUILD=(1,80)
Thanks,
Arun
Back to top
Please enable JavaScript!