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 

COBOL copybooks -> DFSORT Symbols
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Wed Apr 28, 2004 11:13 am    Post subject: COBOL copybooks -> DFSORT Symbols Reply with quote

An improved version of the REXX program to convert COBOL copybooks to DFSORT symbols, along with instructions for using it, is now available. See the "Create DFSORT Symbols from COBOL COPYs" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
_________________
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


Last edited by Frank Yaeger on Mon Sep 11, 2006 6:37 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mfjin
Beginner


Joined: 26 Apr 2003
Posts: 94
Topics: 17

PostPosted: Fri Apr 30, 2004 4:19 am    Post subject: Reply with quote

Frank,

I submitted a job to convert a cobol copybook to symnames layout. The job is running since yesterday hogging up cpu but with no increase in excp count which leads me to believe that it is stuck in a loop. Since I am alien to rexx i am not in a position to go through the code. the job is stuck in the second step (the compile is through).
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: Fri Apr 30, 2004 10:16 am    Post subject: Reply with quote

Send me your COBOL copybook offline (yaeger@us.ibm.com) and I'll see if I can figure out what's going on. Please put "DFSORT" somewhere in your subject line to catch my attention.
_________________
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
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Fri Apr 30, 2004 3:24 pm    Post subject: Reply with quote

I just remembered something. When I was testing, if I didn't specify MAP as a PARM for the COBOL compiler, I got a S322 abend (loop). On the DFSORT webpage I wrote, it says:

Be sure to specify MAP in the PARM field.

and shows:

//COBCOMP EXEC PGM=IGYCRCTL,
// PARM=('APOST,RENT,NOSEQ,MAP',
// 'BUF(20K),OPT(STD),TERM,LIB')

Did you forget to put MAP in there? If so, add MAP and see if that fixes the problem.
_________________
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
kolusu
Site Admin
Site Admin


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

PostPosted: Tue May 04, 2004 10:58 am    Post subject: Reply with quote

After a little bit of research, I was able to make it work.

The main reason for the looping is the rexx exec needs to be in the lower-case. When I uploaded the rexx exec to my pds it converted everything to upper case as my profile is set to caps on.

Once I uploaded the exec with caps off I was able to see the errors as the trace is on.

I started getting return codes of 3629 & 3657

For the return code 3629 it is due to the concatenation symbol | which got translated during upload as broken concatenation symbol
_________________
Kolusu
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: Tue May 04, 2004 11:18 am    Post subject: Reply with quote

Kolusu,

I wonder if mfjin had the same problems you had or if his problem was just that he didn't have MAP. He never responded. Anyway, let's continue to pursue this offline. Thanks.
_________________
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
mfjin
Beginner


Joined: 26 Apr 2003
Posts: 94
Topics: 17

PostPosted: Tue May 04, 2004 12:11 pm    Post subject: Reply with quote

Sorry gentlemen,I am reading this a little late. I shall check my job tomorrow when i go to work and get back to you. I dont remember if my code changed to CAPS ON. But since mine went into an infinite loop like Kolusus , i guess that is what happened. Anyways i shall get back to you on this tomorrow.
Back to top
View user's profile Send private message
mfjin
Beginner


Joined: 26 Apr 2003
Posts: 94
Topics: 17

PostPosted: Wed May 05, 2004 5:27 am    Post subject: Reply with quote

Frank and Kolusu,

I did use MAP. I also checked that my rexx code is in lower case.

I have emailed my copybook layout to Frank.
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 May 05, 2004 9:52 am    Post subject: Reply with quote

I appreciate everybody's help with this REXX. I didn't write it in the first place so I don't know everything it does or how it does it. I did fix up some of the REXX to create better DFSORT symbols. I don't use COBOL, so I was only able to test the REXX with some small COBOL copybooks I found. It's really helpful to have other people test the REXX with larger copybooks and let me know the results.

The datatyp statement you changed it to is correct on the webpage - right?

The PENDING_1 and PENDING_2 is a mistake. I had added an extra PENDING to my DCLSYM01 to test duplicate symbols and forgot to remove it. The output should just have PENDING.

I need to update the page to fix this and discuss some of the other considerations, but I want to understand the problem mfjin is having as well as a problem Kolusu found and his proposed fix before I do the update. And then it will take a while between the time I submit the update and the time it gets uploaded.

I especially appreciate Kolusu's help in identifying what can go wrong.
_________________
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
kolusu
Site Admin
Site Admin


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

PostPosted: Wed May 05, 2004 10:51 am    Post subject: Reply with quote

Frank and other members

Finally I was able to make the exec work for huge copy books. I changed the just one line in the Check_code_line: paragraph.

The original code was checking for spaces. I changed it to look for lineid

original code :

Code:
 

Check_code_line:                                                       
/* Analyze program text line , capture 88 VALUE clauses */         
/* Capture S9, LEADING, SEPARATE parameters             */         
/* Make append lines from *+ comments                   */         
   parse var line 4 linenr 10 flag . 19 . 25 stmt 91               
   if linenr = ''  then return                                 
 


I change the last line in the above code to
Code:
 
                                                 
   if linenr = 'LineID' then return                                 



Now the rexx exec runs fine without any problem and gives the desired results. I also tested the rexx exec with compiled output from VS Cobol II and it execueted without any problem.

Mjfin : Are you passing the sysprint DD listing from the compile step?

Usually when you compile a cobol program the load module is stored in the file associated with SYSLIN DD statement.

And we geneRally pass that to the next step to execuete it.

But in this case we actually need to pass the SYSPRINT DD listing to the rexx exec.

Just for testing I passed the syslin listing of the compile step and guess what the exec goes into an infinite loop eating all the CPU.

Check if you are passing the right listing.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


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

PostPosted: Wed May 05, 2004 11:27 am    Post subject: Reply with quote

I added a few lines for checking if it is a syslin listing.

original code of READ_COBLIST:

Code:

Read_COBLIST:                                       
   l88 = 0                                         
   lx = 0                                           
   na  = 0                                         
   'EXECIO * DISKR COBLIST (FINIS'                 
   parse pull line                                 
   do until substr(line,2,16)  = '  LineID  PL SL '
      parse pull line                               
   end                                             
...



I added a small piece of code after the parse pull line statement

Modified code:

Code:

   if substr(line,2,3)  = 'ESD' then                             
      say '*****************************************************'
      say '          !!!! Wrong Input Detected !!!!!            '
      say ' Pass The SYSPRINT Listing Instead of SYSLIN listing '
      say '          !!!!                      !!!!!            '
      say '*****************************************************'
      RC = 3000                                                   
      exit RC                                                     
   else                                                           
      do until substr(line,2,16)  = '  LineID  PL SL '           
         parse pull line                                         
      end                                                         


I just added the IF statement to check for syslin listing and quits the exec with return code of 3000 if it is syslin listing

mfjin, try to add this code to your exec and see if the jobs ends with a return code of 3000

Kolusu
_________________
Kolusu
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: Wed May 05, 2004 12:17 pm    Post subject: Reply with quote

Kolusu,

I would have preferred to work this all out via e-mail, but since you're posting your observations. I'll post the note I just sent you:

*****
I looked at your problem and came up with a different fix. The problem involves these lines:

Code:

   000057                        15 XICTL-FLOAT-DIGIT     PIC X                 
1PP 5655-G53 IBM Enterprise COBOL for z/OS and OS/390 3.2.0     SAMPLE    Date 0
   LineID  PL SL  ----+-*A-1-B--+----2----+----3----+----4----+----5----+----6--
0  000058                                                 VALUE 'Z'.           


As you can see the new page starts in the middle of a COBOL declare that's split across
two lines. The code to handle the split lines was:

Code:

   if lastpos('.',stmt) = 0 then do
     parse pull line
     parse var line 4 x1 10 x2 . 19 . 25 stmt2 91
     stmt = stmt||stmt2
   end


But to handle the new page in the middle of the split, the code should be:

Code:

   if lastpos('.',stmt) = 0 then do
     parse pull line
     if left(line,1) = '1' then parse pull line
     if substr(line,2,16) = '  LineID  PL SL ' then parse pull line
     parse var line 4 x1 10 x2 . 19 . 25 stmt2 91
     stmt = stmt||stmt2
   end


When I added these lines (without the change you suggested), the job ran to completion and produced the correct symbols.

Can you please try this and see if it works for you.
***********
_________________
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
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Wed May 05, 2004 3:28 pm    Post subject: Reply with quote

mfjin,

I received your copybook, but it wouldn't compile.

At Kolusu's suggestion, I added an 01 line in front of the COPY statement. It then compiled and the REXX program worked fine for me (as it did for Kolusu).
Please try that. If you still have problems, add TIME=(,1) to your job (to limit the time it runs) and move the trace r line in cobdfsym after the /* ... */ lines so trace will be activated. SYSTSPRT will then have the trace activity. Send me your compiler listing and the SYSTSPRT output so I can have a look.

Please let me know if you are still having a problem or not as I'd like to update the web page and REXX program to reflect the changes discussed here.
_________________
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
mfjin
Beginner


Joined: 26 Apr 2003
Posts: 94
Topics: 17

PostPosted: Thu May 06, 2004 5:51 am    Post subject: Reply with quote

Folks

I shall get back to you in some time after trying out with all the changes
suggested
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 May 11, 2004 5:58 pm    Post subject: Reply with quote

I've updated the DFSORT web page with fixes and additional explanations. Thanks to all who helped with this.
_________________
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
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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