MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problems with symnames

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
k99131
Beginner


Joined: 18 Aug 2006
Posts: 10
Topics: 3

PostPosted: Fri Sep 16, 2011 7:28 am    Post subject: Problems with symnames Reply with quote

We have a copy book (RFAVIBKR) generered from a COBOL copy book (using the "Create DFSORT Symbols from COBOL Copy Book" from ftp://ftp.software.ibm.com/storage/dfsort/mvs/sorttrck.pdf) including those particular symnames fields:
Code:
REC,1,1011,CH     
TRANSDAT,1,5,PD   
...
FOERSBEL-EDC_4,1000,6,PD

FOERSBEL-EDC_4 is the last field in the copy book. I have a need to redefine TRANSDAT to test if it contains blanks. I then stated:
Code:
//SYMNAMES DD DSN=PGCC.PR8SEB0A.SYMNAMES(RFAVIBKR),
//            DISP=SHR                             
//         DD *                                     
POSITION,TRANSDAT                                   
TRANSDAT_CH,=,=,CH                                   
But I do not get the result I expected. It becomes
Code:
TRANSDAT_CH,1,6,CH

instead of the desired
Code:
TRANSDAT_CH,1,5,CH

If this is as it should be I do not understand the point of the information is copied from various symnames fields and would welcome an explanation.

Thank you
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12368
Topics: 75
Location: San Jose

PostPosted: Fri Sep 16, 2011 10:36 am    Post subject: Reply with quote

k99131,


Did you read this in here 8.4.2 Symbol Statements

Whenever you use = for m, you must ensure that the previous length is the one you want. In particular, if you insert a new field symbol with the wrong length before a symbol that uses = for m, you will need to change = to the actual length you want.

Using the Keyword POSITION you just set the position but not its length.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Sep 16, 2011 12:43 pm    Post subject: Reply with quote

Quote:
I have a need to redefine TRANSDAT to test if it contains blanks.


You don't need to redefine it. You can use:

Code:

   INCLUDE COND=(TRANSDAT,CH,EQ,C' ')


to do what you want. DFSORT will transform it to:

Code:

  INCLUDE COND=(1,5,CH,EQ,C' ')   

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
k99131
Beginner


Joined: 18 Aug 2006
Posts: 10
Topics: 3

PostPosted: Mon Sep 19, 2011 3:46 am    Post subject: Reply with quote

Kolusu, thanks for the reply. Unfortunately, I find this rule confusing and does not see the point of being able to use "=" for m after a POSITION statement.


Thanks Frank Yaeger, it solved my current problem.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Mon Sep 19, 2011 5:03 am    Post subject: Reply with quote

K99131

normally I don't interject in Sort questions,
but even I understand, am not confused, and am somewhat irritated by your response.

Code:

REC,1,1011,CH     
TRANSDAT,1,5,PD   
...
FOERSBEL-EDC_4,1000,6,PD

the last length is 6.
afterwards, you add a POSITION statement, and I repeat what Kolusu said:
Using the Keyword POSITION you just set the position but not its length.

easy rule to remember. POSITION sets POSITION, but not m.
Had the statement prior to the POSITION an m of 5, you could have gotten away with it.
but all you would have to do is insert another statement before the POSITION and you run the risk of a bad m, again.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
k99131
Beginner


Joined: 18 Aug 2006
Posts: 10
Topics: 3

PostPosted: Mon Sep 19, 2011 7:31 am    Post subject: Reply with quote

dbzTHEdinosauer, I do not understand why you should be annoyed. I thank Kolusu but write that I do not understand why the rule is such.

Perhaps lost nuances of the language because I use Google Translate.
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Mon Sep 19, 2011 11:56 am    Post subject: Reply with quote

Quote:
Perhaps lost nuances of the language


Perhaps the bigest challange on these "boards" is language. Quite often people post something with good intentions, but the wording causes rather negative reactions.
_________________
All the best,

di
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Sep 19, 2011 12:04 pm    Post subject: Reply with quote

Quote:
I find this rule confusing and does not see the point of being able to use "=" for m after a POSITION statement.


Although using "=" for m after POSITION,name is allowed, it is NOT the purpose for "=" for m. "=" for m has other purposes. For example, if you had a group of volsers, you could use "=" for m like this:

Code:

VOLSER1,21,6,CH
VOLSER2,*,=,=
VOLSER3,*,=,=


POSITION,name is like ORG in Assembler. It lets you reuse an area in a different way. From the DFSORT book:

As an example of how POSITION,symbol can be used, if you specify the following SYMNAMES statements:

Code:

Workarea,21,100 Use workarea for volsers
  volser1,=,6,CH
  volser2,*,6,CH
POSITION,Workarea Reuse workarea for status and dsname
  status,=,1,BI
  dsname,*,44,CH


As I said in my previous post there is no need to redefine a field with the same position and length as another just to change the format so "=" for m isn't needed for that purpose.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
k99131
Beginner


Joined: 18 Aug 2006
Posts: 10
Topics: 3

PostPosted: Tue Sep 20, 2011 7:44 am    Post subject: Reply with quote

Thanks for clarifying that it is not the purpose that you should use the "=" in that case.

I try to use symnames wherever possible to avoid hard coding. If I could make a wish for future versions would be that it was possible to use symnames everywhere.

(Translated through Google translate Confused )
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Sep 20, 2011 11:59 am    Post subject: Reply with quote

Quote:
If I could make a wish for future versions would be that it was possible to use symnames everywhere.


I'm glad you like DFSORT symbols. Where exactly do you want to use symbols that you can't?
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
k99131
Beginner


Joined: 18 Aug 2006
Posts: 10
Topics: 3

PostPosted: Wed Sep 21, 2011 5:29 am    Post subject: Reply with quote

Only a few examples:

OUTLEN=n
STARTPOS for FINDREP
OUTFIL REPEAT=n
SEQNUM

Basically, wherever a constant value must be specified, it would be good to be able to use symnames.

Moreover, where you should enter a length, it would be nice if it could be picked from a symnames field. For example:
FIELD-A,1,6,PD

Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Sep 21, 2011 12:14 pm    Post subject: Reply with quote

Thanks for the clarification.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
k99131
Beginner


Joined: 18 Aug 2006
Posts: 10
Topics: 3

PostPosted: Thu Sep 22, 2011 1:57 am    Post subject: Reply with quote

Thank you. It is encouraging to possibly get to influence developments. Smile

(Partially translated by Google Translate Confused )
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group