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
 

 

Building commands dynamically using SYNCORT

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

New User


Joined: 09 Jan 2014
Posts: 7
Location: India

PostPosted: Mon Mar 10, 2014 6:16 pm    Post subject: Building commands dynamically using SYNCORT
Reply with quote

I am posting this question after having searched a lot across the web.

My requirement is to replace an existing set of logic that was written in STARBAT with any other utility.

Below is the STARBAT step. (My workplace doesn't allow posting the code snap. Sorry about that)

//STEP1 EXEC PGM=STARBAT

//DD01 DD DSN=FILE1,DISP=SHR /* contains a number say 123456789 */

//OUT1 DD DSN=OUTFILE,DISP=NEW,CATLG

//SYSIN DD *

$$DD01 USER MAXENT=9999,
MOVE=(1,80C' ')
MOVE=(1,C'*'),
WRITE OUT1,
*
MOVE=(3,C"IF=(3,EQ,C'PIROOT'),REPL=(45,EQ,X'"),
MOVE=(+0,9,1),
WRITE OUT1
*/

Now at the end of this step. OUTFILE will have the content

IF=(3,EQ,C'PIROOT'),REPL=(45,EQ,X'123456789


So here, with the command MOVE=(+0,9,1) they are some how moving the number 123456789 that is present in FILE1.

I want to know how the same can be achieved through SYNCSORT or anyother utilities.

I have done a lot of search before posting this query. Your suggestion would get me in the right direction.

Thanks in advance.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Mar 10, 2014 6:27 pm    Post subject: Reply to: Building commands dynamically using SYNCORT
Reply with quote

what happened when You looked at the SYNCSORT manuals

IFTHEN,BUILD,OVERLAY

search the forum for examples ( gazillions of them )
and meditate if the logic apply to Your requirement

the proper way of asking sort related questions
is to post
input data
expected output
processing logic

from the sample You posted is not easy to understand Your requirement
Back to top
View user's profile Send private message
rokes

New User


Joined: 09 Jan 2014
Posts: 7
Location: India

PostPosted: Tue Mar 11, 2014 3:10 pm    Post subject:
Reply with quote

hi enricho,

I tried Tthe following

SORT FIELDS=COPY
OUTREC FIELDS=(1:C'IF(3,EQ,C'PIROOT'),REPL=(45,EQ,X'''1,9,C''')')

---SORTIN file has 123456789 at 1:9---

Expected output:

IF(3,EQ,C'PIROOT'),REPL=(45,EQ,X'123456789C')



Error:

WER275A - NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A - NO KEYWORDS FOUND ON CONTROL STATEMENT

version : SYNCSORT FOR Z/OS - 1.4.1.0R
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Tue Mar 11, 2014 3:59 pm    Post subject: Reply to: Building commands dynamically using SYNCORT
Reply with quote

You get two message, so both your cards are wrong. I suspect that you do not have a blank in the first column of your control cards:

Code:
 SORT FIELDS=COPY
 OUTREC BUILD=(C'IF(3,EQ,C'PIROOT'),REPL=(45,EQ,X'''1,9,C''')')
Back to top
View user's profile Send private message
rokes

New User


Joined: 09 Jan 2014
Posts: 7
Location: India

PostPosted: Tue Mar 11, 2014 4:12 pm    Post subject:
Reply with quote

icon_eek.gif Yes.

Good catch. But I still face the below error after correcting it.

Code:
WER268A OUTREC STATEMENT  :SYNTAX ERROR
[/code]
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Tue Mar 11, 2014 4:29 pm    Post subject: Reply to: Building commands dynamically using SYNCORT
Reply with quote

You don't have enough single-quotes. C'PIROOT' you want to appear as that value, so you'll need C''PIROOT''.

I'm not going to check the rest. If you want one single-quote in your output, you have to supply it as two consecutive single-quotes, every time.
Back to top
View user's profile Send private message
rokes

New User


Joined: 09 Jan 2014
Posts: 7
Location: India

PostPosted: Tue Mar 11, 2014 4:58 pm    Post subject:
Reply with quote

That is it. Thanks a lot!

Such syntaxes are hardly used in the examples or manuals.

Thanks again Bill!
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue Mar 11, 2014 5:22 pm    Post subject: Reply to: Building commands dynamically using SYNCORT
Reply with quote

but You can find lots of examples here on the forum
Back to top
View user's profile Send private message
rokes

New User


Joined: 09 Jan 2014
Posts: 7
Location: India

PostPosted: Wed Mar 12, 2014 1:41 pm    Post subject: Re: Reply to: Building commands dynamically using SYNCORT
Reply with quote

enrico-sorichetti wrote:
but You can find lots of examples here on the forum


Excuse me for that.

Bill,

One last doubt.

When we specify the OUTREC FIELDS, can we make a part of the string to be written in the next line in the SORTOUT file.

Actual:

Code:
IF(3,EQ,C'PIROOT'),REPL=(45,EQ,X'123456789C')



Expected:

Code:
IF(3,EQ,C'PIROOT'),
REPL=(45,EQ,X'123456789C')
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Wed Mar 12, 2014 2:34 pm    Post subject: Reply to: Building commands dynamically using SYNCORT
Reply with quote

No, you can't even do it with OUTREC BUILD, which is identical to but much more clear than OUTREC FIELDS.

You can, however, do it with OUTFIL BUILD (or OUTFIL OUTREC, which is identical, but much less clear - don't even go there).


Code:
  OUTFIL BUILD=(stufftogoonthefirstline,
                /,
                stufftogoonthesecondline)
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 FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm
No new posts Invoking CA 7 commands through REXX kenshin CLIST & REXX 10 Fri Aug 12, 2016 9:33 pm
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
No new posts PL/I: opening file w/ dynamically det... Sam Dodgers PL/I & Assembler 6 Wed Jul 27, 2016 4:05 pm


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