IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort - Retreiving the numeric values


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Mon Sep 15, 2008 10:46 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Sep 15, 2008 11:27 pm
Reply with quote

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
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Tue Sep 16, 2008 2:20 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Sep 16, 2008 2:25 am
Reply with quote

Hello,

Please post the error message including the message id.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Tue Sep 16, 2008 4:59 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Sep 16, 2008 5:48 am
Reply with quote

Hi,

WER messages means you are using SYNCSORT and not DFSORT.

Gerry
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Sep 16, 2008 10:20 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Sep 16, 2008 7:32 pm
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Sep 17, 2008 9:05 pm
Reply with quote

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. icon_cry.gif
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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top