|
View previous topic :: View next topic
|
| Author |
Message |
juares castro
New User
Joined: 04 May 2012 Posts: 34 Location: Brazil
|
|
|
|
Hi everyone...
Could we use position and length field (p,n) in syncsort as a result of
arithmetic addition or subtraction? I mean, where we would use...
as an example:
.
.
.
// EXPORT SYMLIST=(pp,sz)
.
.
//SYSIN DD *,SYMBOLS=EXECSYS
.
.
.
... ,(OVERLAY=(&pp+1:100,15,... or
... ,(BUILD=(&pp+3:100,(&sz+5),...
resulting...
... ,(OVERLAY=(31:100,15,... or
... ,(BUILD=(33:100,25,...
where: &pp values "30", &sz values "20" |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
1) Why not to try it in your own test?
2) Why not to read any of SORT manuals? |
|
| Back to top |
|
 |
juares castro
New User
Joined: 04 May 2012 Posts: 34 Location: Brazil
|
|
|
|
Hi Sergeyken!
Before post here, I tried in my own test. Believe me.
And I did not get any mention about using variable position or length in Sort manuals regarding SORT, INREC, OUTREC,... statements. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| juares castro wrote: |
Hi Sergeyken!
Before post here, I tried in my own test. Believe me.
And I did not get any mention about using variable position or length in Sort manuals regarding SORT, INREC, OUTREC,... statements. |
That only proves to me again, and again, that you are not able to make any logical conclusion from existing facts. This is very-very typical problem for modern "experts in computer games" who claim themselves as "Senior Software Architecture Experts".
1) If you tried it in your own tests, where are the results of your attempts???
2) Do you have any minor idea, how the variables in your examples are to be handled, and which components are involved?
3) The JCL-variables can only be substituted by one of JES component as part of in-stream text. At this moment, JES has no idea about the meaning of any characters/symbols/operations/whatever else around this and only this JCL-variable name, starting from an ampersand. Any
BUILD=(&pp+1:100,....
has no meaning for JES except the part of &pp detected by its parser. It must be obvious for anyone who had ever learned the basics of computer programming.
So, at this stage only specific value of variable &pp can be substituted as character string in the middle of in-stream data supposed in the future to become an utility control statement.
4) At step execution time, the utility (SORT, or any other) just reads the updated in-stream text with JCL-parameters already replaced by their values earlier by JES. The utility can read this text only as
BUILD=(123+1:100,...
You can easily find out from SORT manual(s) if this syntax is allowed, or not? In theory, a smart enough utility would be able to handle expressions like this; but AFAIK the current versions of SORT utilities do not.
5) Again, when you "tried your own test", what are the results? I expect that everything I explained above (spending my own time for free!) must be obviously concluded from your test results. |
|
| Back to top |
|
 |
juares castro
New User
Joined: 04 May 2012 Posts: 34 Location: Brazil
|
|
|
|
Sergeyken,
I just trying to know if that is possible.
I do not know about your time or how expert I am or You are.
Please, do not spend your time. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| juares castro wrote: |
Sergeyken,
I just trying to know if that is possible.
I do not know about your time or how expert I am or You are.
Please, do not spend your time. |
This is the major problem:
You are not trying to know if that is possible.
You are trying to make others to do your own job, because - despite of your current occupation, and position - you cannot make even elementary logical conclusion from obvious facts.
You even do not try to do it, and probably you never did this in the whole your life.
Once again: where are the results of your attempts to do something????? |
|
| Back to top |
|
 |
juares castro
New User
Joined: 04 May 2012 Posts: 34 Location: Brazil
|
|
|
|
Hi again...
Here a simple teste I tryed execute. My requirement is a little bit strong, but needing flexible positons and lengths as below:
| Code: |
// EXPORT SYMLIST=(KL)
//*
// SET KL=5
//*
//STEP10 EXEC PGM=SYNCSORT,REGION=7M
//SORTIN DD *
12345678901234567890XXXXXXXXXXXXXXXXXXX
23456789012345678901YYYYYYYYYYYYYYYYYYY
89012345678901234567ZZZZZZZZZZZZZZZZZZZ
45678901234567890123AAAAAAAAAAAAAAAAAAA
12345678901234567890BBBBBBBBBBBBBBBBBBB
78901234567890123456CCCCCCCCCCCCCCCCCCC
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *,SYMBOLS=EXECSYS
SORT FIELDS=(1,&KL,A),FORMAT=BI
OUTREC FIELDS=((+&KL,ADD,+1):(+&KL,ADD,+1),(+80,SUB,+&KL))
//SYSOUT DD SYSOUT=*
//*
//
SYNCSORT FOR Z/OS 2.1.7.0R
SYSIN :
SORT FIELDS=(1,5,A),FORMAT=BI
OUTREC FIELDS=((+5,ADD,+1):(+5,ADD,+1),(+80,SUB,+5))
*
WER813I INSTALLATION OPTIONS IN MFXPRMCT WILL BE USED
WER268A OUTREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
|
As You can see, in OUTREC statement We have: "p:s,e" (position:start,end) |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3108 Location: NYC,USA
|
|
|
|
| Simple test is to see if it works by Hardcoding the +5 value. if it works then change it dynamic one. This way you can be sure the syntax is correct. |
|
| Back to top |
|
 |
Marso
REXX Moderator

Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
| Code: |
SORT FIELDS=(1,5,A),FORMAT=BI
OUTREC OVERLAY=(1,5C' ') |
is equivalent to
| Code: |
SORT FIELDS=(1,5,A),FORMAT=BI
OUTREC FIELDS=(6:6,75) |
and much easier to code:
| Code: |
SORT FIELDS=(1,&KL,A),FORMAT=BI
OUTREC OVERLAY=(1:&KL.C' ') |
|
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| juares castro wrote: |
Hi again...
Here a simple teste I tryed execute. My requirement is a little bit strong, but needing flexible positons and lengths as below:
| Code: |
SORT FIELDS=(1,&KL,A),FORMAT=BI
OUTREC FIELDS=((+&KL,ADD,+1):(+&KL,ADD,+1),(+80,SUB,+&KL))
SYNCSORT FOR Z/OS 2.1.7.0R
SYSIN :
SORT FIELDS=(1,5,A),FORMAT=BI
OUTREC FIELDS=((+5,ADD,+1):(+5,ADD,+1),(+80,SUB,+5))
*
WER813I INSTALLATION OPTIONS IN MFXPRMCT WILL BE USED
WER268A OUTREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
|
As You can see, in OUTREC statement We have: "p:s,e" (position:start,end) |
Oh, poor juares castro…
You do not have in your example any "p:s,e" (position:start,end)
What you do have is ((expression):(expression),(expression))
This is an absolutely different entity taken from completely different place of the SORT manual.
This new format (+&KL,ADD,+1) is even more senseless than previously used (&KL+1)
I'm sorry, but I need to recommend you again: start learning the basic principles of computer programming. You can start from re-reading my previous detailed explanation.
So far you do not understand even the simplest syntax diagrams from utility manuals... |
|
| Back to top |
|
 |
juares castro
New User
Joined: 04 May 2012 Posts: 34 Location: Brazil
|
|
|
|
Oh, poor Sergeyken!!!
You still do not understand what was my question...
And it is there all time. But you are preoccupied to be impolite.
My point is exactly what I tryed write: intead have fixed values to "position:", "start position" and "length" (p:s,l) I am trying to know if it is possible or not using a variable expression on that specification. Simple: ( )YES ( )NO.
And please, I am not good spending your precious time. To you, end. |
|
| Back to top |
|
 |
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Another approach is to dynamically build your sort cards.
In my example below I use a Rexx exec to build the sort cards.
Not in a single step, but who cares. It gets the job done.
| Code: |
//* CREATE SORT CARD WITH POSITIONS START END
//SYMBOLIC SET POS0=5
//STEP1 EXEC PGM=IRXJCL,PARM='SETPOS &POS0'
//SYSEXEC DD DSN=MY.REXX.LIB,DISP=SHR
//SYSTSPRT DD SYSOUT=Z
//CARDOUT DD DSN=TEMP.&SYSUID..SORTCARD,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,1)),
// BLKSIZE=0,
// LRECL=80,
// RECFM=FB
//*
//STEP10 EXEC PGM=SYNCSORT,REGION=7M
//SORTIN DD *
12345678901234567890XXXXXXXXXXXXXXXXXXX
23456789012345678901YYYYYYYYYYYYYYYYYYY
89012345678901234567ZZZZZZZZZZZZZZZZZZZ
45678901234567890123AAAAAAAAAAAAAAAAAAA
12345678901234567890BBBBBBBBBBBBBBBBBBB
78901234567890123456CCCCCCCCCCCCCCCCCCC
/*
//SORTOUT DD SYSOUT=Z
//SYSIN DD DSN=TEMP.&SYSUID..SORTCARD,DISP=SHR
//SYSOUT DD SYSOUT=Z |
Rexx Code
| Code: |
/* REXX EXEC FOR SETTING POSITION START AND END */
ARG POS0
POS1 = POS0 + 1
START = POS0 + 1
ENDPOS = 80 - POS0
O. = ''
O.1 = ' SORT FIELDS=(1,'POS0',A),FORMAT=BI'
O.2 = ' OUTREC FIELDS=('POS1':'START','ENDPOS')'
"EXECIO 2 DISKW CARDOUT (STEM O. OPEN FINIS"
EXIT |
|
|
| Back to top |
|
 |
juares castro
New User
Joined: 04 May 2012 Posts: 34 Location: Brazil
|
|
|
|
Thanks Daveporcelan!
That is a good idea!
I will try do that. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3108 Location: NYC,USA
|
|
|
|
You can also try this two step solution,
1. You can use the value 5 in SORT IN and in SORTOUT try BUILD the SORT CARD
2. Use the SORTCARD created in step1.
So whenever you want to change the input value change the SORTIN Data Set and edit to new value. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| juares castro wrote: |
Oh, poor Sergeyken!!!
You still do not understand what was my question...
And it is there all time. But you are preoccupied to be impolite.
My point is exactly what I tryed write: intead have fixed values to "position:", "start position" and "length" (p:s,l) I am trying to know if it is possible or not using a variable expression on that specification. Simple: ( )YES ( )NO.
And please, I am not good spending your precious time. To you, end. |
My point was: the answer to your question is obvious to anyone who has ever opened the JCL+SORT manuals.
I'm 150% sure you never did it. You always ask people around you: "Please, which button do I need to click to perform my job?"
Bye, all the best |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|