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
 

 

Syncsort - Retreiving the numeric values

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - Retreiving the numeric values
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    Post subject: Reply to: Retreiving the numeric values
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:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/

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    Post subject:
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

Site Director


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

PostPosted: Tue Sep 16, 2008 2:25 am    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Tue Sep 16, 2008 5:48 am    Post subject:
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: 2276
Location: @my desk

PostPosted: Tue Sep 16, 2008 10:20 am    Post subject:
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

Site Director


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

PostPosted: Tue Sep 16, 2008 7:32 pm    Post subject:
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: 2276
Location: @my desk

PostPosted: Wed Sep 17, 2008 9:05 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am


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