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

Using 'parm' to vary SORTOUT record values ?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 55
Location: USA

PostPosted: Wed Sep 07, 2016 9:24 pm
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

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Wed Sep 07, 2016 9:38 pm
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: 55
Location: USA

PostPosted: Wed Sep 07, 2016 10:05 pm
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

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Wed Sep 07, 2016 10:10 pm
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: 213
Location: Chennai

PostPosted: Wed Sep 07, 2016 10:14 pm
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: 55
Location: USA

PostPosted: Wed Sep 07, 2016 10:22 pm
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

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Wed Sep 07, 2016 10:34 pm
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

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Wed Sep 07, 2016 10:41 pm
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: 55
Location: USA

PostPosted: Wed Sep 07, 2016 10:48 pm
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: 55
Location: USA

PostPosted: Wed Sep 07, 2016 11:04 pm
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: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Sep 07, 2016 11:08 pm
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

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Wed Sep 07, 2016 11:36 pm
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: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Sep 07, 2016 11:40 pm
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: 55
Location: USA

PostPosted: Wed Sep 07, 2016 11:47 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top