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

Building commands dynamically using SYNCORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Mar 10, 2014 6:27 pm
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Mar 11, 2014 3:59 pm
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Mar 11, 2014 4:29 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Mar 11, 2014 5:22 pm
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Mar 12, 2014 2:34 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Dynamically pass table name to a sele... DB2 2
No new posts building java class with zip4j.jar on... Java & MQSeries 0
No new posts FD Section to Create FB or Vb File Dy... COBOL Programming 1
No new posts Console Commands All Other Mainframe Topics 4
No new posts commands missing in JESMSGLG JCL & VSAM 3
Search our Forums:

Back to Top