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
 

 

Question on existing Syncsort topic

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Aug 20, 2009 7:05 pm    Post subject: Question on existing Syncsort topic
Reply with quote

Hi,

The question is with reference to Syncsort - Retreiving the numeric values


I have used below input data and SORT job:
Code:

//STEP0100 EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                       
ROOT11111 ACU00ACUPUNCTURE                           
CHILD2 ..ACU00DABB DABBDC                             
CHILD2 ..ACU00DAB1 DAB1DC                             
CHILD2 ..ACU00DAB2 DAB2DC                             
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 *                                       
  OPTION COPY                                               
  INREC IFTHEN=(WHEN=GROUP,                                 
    BEGIN=(1,4,CH,EQ,C'ROOT',AND,5,5,ZD,EQ,NUM),PUSH(81:ID=1))
/*                                                         


I am getting the below output (Not expected)..
Code:

ROOT11111 ACU00ACUPUNCTURE
CHILD2 ..ACU00DABB DABBDC
CHILD2 ..ACU00DAB1 DAB1DC
CHILD2 ..ACU00DAB2 DAB2DC
ROOTACU00 ACU00ACUPUNCTURE
CHILD ..ACU00DABB DABBDC 
CHILD ..ACU00DAB1 DAB1DC 
CHILD ..ACU00DAB2 DAB2DC 
ROOT12345 ACU00ACUPUNCTURE
CHILD1 ..ACU00DABB DABBDC
CHILD1 ..ACU00DAB1 DAB1DC
CHILD1 ..ACU00DAB2 DAB2DC


How to get the below result (Expected)...
Code:

ROOT11111 ACU00ACUPUNCTURE
CHILD2 ..ACU00DABB DABBDC
CHILD2 ..ACU00DAB1 DAB1DC
CHILD2 ..ACU00DAB2 DAB2DC
ROOT12345 ACU00ACUPUNCTURE
CHILD1 ..ACU00DABB DABBDC
CHILD1 ..ACU00DAB1 DAB1DC
CHILD1 ..ACU00DAB2 DAB2DC
Back to top
View user's profile Send private message

Arun Raj

Moderator


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

PostPosted: Thu Aug 20, 2009 7:48 pm    Post subject:
Reply with quote

ramsri,

I dont think the WHEN=GROUP solution posted in the other thread will give you the desired results. Did you try the SYNCTOOL solution posted by me there?

Or If you're looking for a WHEN=GROUP solution, Change your SYSIN as below .
Code:
//SYSIN    DD *                               
  OPTION COPY                                 
  INREC IFTHEN=(WHEN=GROUP,                   
    BEGIN=(1,4,CH,EQ,C'ROOT'),PUSH(81:5,5))   
  OUTFIL INCLUDE=(81,5,FS,EQ,NUM),BUILD=(1,80)
/*
BTW you could have replied to the same topic instead of starting off a new topic.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Aug 20, 2009 8:09 pm    Post subject: Reply to: Question on existing Syncsort topic
Reply with quote

Arun, somewhere I read that one should not open a very old thread....not sure. I thought it was achievable using WHEN=GROUP...

Ok....Thanks.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Aug 20, 2009 8:15 pm    Post subject:
Reply with quote

Arun, I tested it with both

Code:

OUTFIL INCLUDE=(81,5,FS,EQ,NUM),BUILD=(1,80)


and

Code:

OUTFIL INCLUDE=(81,5,ZD,EQ,NUM),BUILD=(1,80)


Why to use FS? Any specific reason?

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

Moderator


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

PostPosted: Thu Aug 20, 2009 8:26 pm    Post subject:
Reply with quote

Quote:
I thought it was achievable using WHEN=GROUP
Is it working now??
Quote:
Why to use FS? Any specific reason?
We just need a character numeric check here and FS will do exactly that. ZD will check for zoned decimal numerics. Both should work fine, but in this case only FS is required.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Aug 20, 2009 8:49 pm    Post subject: Reply to: Question on existing Syncsort topic
Reply with quote

Oh...Yeah......it is working. The solutions given by you can't go wrong icon_biggrin.gif
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Aug 20, 2009 9:02 pm    Post subject:
Reply with quote

Arun, Why the the piece of code fails?

Code:

//SYSIN    DD *                                       
  OPTION 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)
/* 


I don't understand why it applies number to the CHARACTER data (ROOTACU00) where as the condition looks for "5,5,ZD,EQ,NUM !

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

Moderator


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

PostPosted: Thu Aug 20, 2009 10:48 pm    Post subject:
Reply with quote

Ramsri,

It's not failing. It is just doing whatever it has been asked to do. icon_biggrin.gif
Code:
BEGIN=(1,4,CH,EQ,C'ROOT',AND,5,5,ZD,EQ,NUM),PUSH(81:ID=1))
will identify the start of a new GROUP whenever it encounters a 'ROOTnnnnn' where n=0 thru 9. Remember it does not specify where the GROUP should end. Hence in the above example you have an unwanted GROUP starting with 'ROOTACU00' in between; but the 'PUSH'ing of ID field is continued until the beginning of another 'ROOTnnnnn'. Hope it's clear to you now.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Aug 21, 2009 9:19 am    Post subject: Reply to: Question on existing Syncsort topic
Reply with quote

Arun, I am happy that my assumption is true. Thanks for the details.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Aug 21, 2009 9:24 am    Post subject:
Reply with quote

You're welcome. icon_smile.gif
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Aug 21, 2009 9:38 am    Post subject: Reply to: Question on existing Syncsort topic
Reply with quote

Arun, is it still possible to code a BEGIN and END to achieve what is achieved with other way around?

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

Moderator


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

PostPosted: Fri Aug 21, 2009 9:49 am    Post subject:
Reply with quote

Here we dont have anything specific in the input data which identifies the ending of a GROUP. Why do you need a solution using both 'BEGIN' and 'END' when a BEGIN alone would do the same.icon_biggrin.gif
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Aug 21, 2009 12:37 pm    Post subject: Reply to: Question on existing Syncsort topic
Reply with quote

I am not looking for the BEGIN and END solution but wanted know if it is possible icon_confused.gif
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 syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Fault Analyzer - listings question. egrove IBM Tools 4 Thu Aug 11, 2016 5:31 pm


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