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
 

 

Using 'parm' to vary SORTOUT record values ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 49
Location: USA

PostPosted: Wed Sep 07, 2016 9:24 pm    Post subject: Using 'parm' to vary SORTOUT record values ?
Reply with quote

Could anyone please help me setup ICEMAN or DFSORT to change a value in a column based on what is in the 'parm card'? Even if I have to concat the parm to the SORTIN. Thank you for any advice you can give.

Code:
Parm
05200  KKK 000 -03 -02 -01 0000000000000


Input
Code:
SERVER.100.1100
Someones_password
CD /NewDirectory
PUT 'SYSXX.SOMTHING.DATA1’ THEIRQQQ.SOMETHING1.txt
PUT 'SYSXX.SOMTHING.DATA2’ THEIRQQQ.SOMETHING2.txt
PUT 'SYSXX.SOMTHING.DATA3’ THEIRQQQ.SOMETHING3.txt
Dir
QUIT


Output
Code:
SERVER.100.1100
Someones_password
CD /NewDirectory
PUT 'SYSXX.SOMTHING.DATA1’ THEIR333.SOMETHING1.txt
PUT 'SYSXX.SOMTHING.DATA2’ THEIR333.SOMETHING2.txt
PUT 'SYSXX.SOMTHING.DATA3’ THEIR333.SOMETHING3.txt
Dir
QUIT


Problematic Sort Cards
Code:
SORT FIELDS=COPY
 INREC IFTHEN=(WHEN=(8,3,CH,EQ,C'KKK')),
 OUTREC OVERLAY=(WHEN=(47,3,EQ,C'QQQ')),
        BUILD=(47,3,C'333')

Code'd for you this time
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Wed Sep 07, 2016 9:38 pm    Post subject:
Reply with quote

You have been here for 11 years and don't know how to make use of code tags? I have done it and see now how easy for everyone it is to understand it, please make a hobbit of using BB codes next time.
Back to top
View user's profile Send private message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 49
Location: USA

PostPosted: Wed Sep 07, 2016 10:05 pm    Post subject:
Reply with quote

Yes, you are right Rohit.
Code:
Next time I will do that

icon_redface.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Wed Sep 07, 2016 10:10 pm    Post subject:
Reply with quote

If 'KKK' is in the parm then you wanted '333' at the final SORTOUT and input dataset already have 'QQQ' in it ,right then why do you need OVERLAY for 'QQQ'?
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 159
Location: Chennai

PostPosted: Wed Sep 07, 2016 10:14 pm    Post subject: Reply to: Using 'parm' to vary SORTOUT record values ?
Reply with quote

Sysaron

Your parm doesn't have any 333 value.

How did you get the output updated with 333.

Code:

PUT 'SYSXX.SOMTHING.DATA1’ THEIR333.SOMETHING1.txt
PUT 'SYSXX.SOMTHING.DATA2’ THEIR333.SOMETHING2.txt
PUT 'SYSXX.SOMTHING.DATA3’ THEIR333.SOMETHING3.txt



You have to tell us what has to be reflected in the output from the parm.
Back to top
View user's profile Send private message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 49
Location: USA

PostPosted: Wed Sep 07, 2016 10:22 pm    Post subject:
Reply with quote

Hi Magesh,

The parm with KKK is used for many many other jobs, so it needs to stay KKK.

But if it is used with this DFSORT (that I am trying to create), I would like the Sortin QQQ in column 47 to be replaced with 333 in column 47 in the Sortout file.

Other times the parm will have FFF and the QQQ will be replaced with 686 (in another job with other sort cards).

Thanks for your help!
Back to top
View user's profile Send private message
sergeyken

New User


Joined: 29 Apr 2008
Posts: 37
Location: Maryland

PostPosted: Wed Sep 07, 2016 10:34 pm    Post subject:
Reply with quote

1. This code
Code:
SORT FIELDS=COPY
  INREC IFTHEN=(WHEN=(8,3,CH,EQ,C'KKK')),
  OUTREC OVERLAY=(WHEN=(47,3,EQ,C'QQQ')),
         BUILD=(47,3,C'333')

would cause SYNTAX ERROR, and it is senseless.

Please clarify more clearly the roles of KKK, QQQ, and 333?

2. Parameters for SORT can be passed as follows
Code:
//PARMSORT EXEC PGM=SORT,PARM='JP1"KKK",JP2"QQQ",JP3"333"' 
//SYSOUT DD SYSOUT=*
//SYMNOUT DD SYSOUT=*
//SORTIN DD . . . . . . . . . 
//SORTOUT DD SYSOUT=*
//SYSIN DD * 
 SORT FIELDS=COPY
 INREC IFTHEN=(WHEN=(8,3,CH,EQ,JP1)),
 OUTREC OVERLAY=(WHEN=(47,3,EQ,JP2)),
         BUILD=(47,3,JP3)

but the statements under SYSIN DD * are absolutely senseless from SORT syntax point of view... icon_rolleyes.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Wed Sep 07, 2016 10:41 pm    Post subject:
Reply with quote

Right, JP2 should be '333' and there is not need of JP3.
Back to top
View user's profile Send private message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 49
Location: USA

PostPosted: Wed Sep 07, 2016 10:48 pm    Post subject:
Reply with quote

Yes, they are senseless. But I believe I can do something with what you suggested.

I just have to figure a way to put that 'parm=' coding into a dataset that I can change the parm literals with each run, so I don't need to keep re-implementing the JCL every time I need to change the parm values.
Thanks for your help.
Back to top
View user's profile Send private message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 49
Location: USA

PostPosted: Wed Sep 07, 2016 11:04 pm    Post subject:
Reply with quote

I guess the best way to explain is that JP1 and JP3 are variable with every job run.
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 268
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Sep 07, 2016 11:08 pm    Post subject:
Reply with quote

Quote:
I just have to figure a way to put that 'parm=' coding into a dataset

You can use SYMNAMES for that. Check this link.
Back to top
View user's profile Send private message
sergeyken

New User


Joined: 29 Apr 2008
Posts: 37
Location: Maryland

PostPosted: Wed Sep 07, 2016 11:36 pm    Post subject:
Reply with quote

mistah kurtz wrote:
Quote:
I just have to figure a way to put that 'parm=' coding into a dataset

You can use SYMNAMES for that. Check this link.

SYMNAMES does not support JCL parameters as required.
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 268
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Sep 07, 2016 11:40 pm    Post subject:
Reply with quote

What I was thinking that the TS can follow a two steps solution. In first step build the SYMBOLS, using the parm data and then in next step use that as needed.
Back to top
View user's profile Send private message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 49
Location: USA

PostPosted: Wed Sep 07, 2016 11:47 pm    Post subject:
Reply with quote

YES Mistah!
That will work Perfectly!
Thanks again so much for your assistance everyone icon_cool.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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm


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