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

Converting all PD Fields in a dataset to ZD.


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

New User


Joined: 22 Sep 2006
Posts: 12

PostPosted: Thu May 17, 2007 6:06 pm
Reply with quote

Hi,

I have a PS dataset with below specification,
Record format: FB
Record length: 5609
Block size: 16827

It has around 50 PD fields (probably more than that) at different positions.
I want to convert all those PD fields to ZD.

One way to do this is, providing all PD field's positions in the OUTREC FIELDS. But it is very tough to mention all the PS fields positions.

Is there any other way??
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Thu May 17, 2007 6:15 pm
Reply with quote

as far as I know, NO.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu May 17, 2007 8:06 pm
Reply with quote

You could create a layout of the record using DFSORT Symbols and then give the symbol names rather than the positions. For complete information on using DFSORT Symbols, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/7.0?DT=20060615185603

If you have a COBOL Copy book for the record layout, you can create the DFSORT Symbols automatically. For details, see the "Create DFSORT Symbols from COBOL COPYs" Smart DFSORT Trick at:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 18, 2007 2:58 am
Reply with quote

Hello,

For a record that size, i imagine there is a COBOL copybook.

If this were my task, i'd clone the copybook with the packed fields to another with the same field names, but with zoned pic's rather than packed.

Then i'd code a simple read, move corresponding, write bit of code and be done with it.

Using field names is a lot smoother than keeping track of displacement/length in bytes for the whole record.
Back to top
View user's profile Send private message
Jonnala

New User


Joined: 22 Sep 2006
Posts: 12

PostPosted: Tue May 22, 2007 3:22 pm
Reply with quote

Hi Dick,

Can we move Group Item which contains Elemenrary level Packed fields to another Group Item??

It is giving SOC4 Abend, if I use MOVE CORRESPONDING.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue May 22, 2007 3:29 pm
Reply with quote

A group move will not do what you want.
The 0C4 says you are referencing storage you don't own, can you post a small example of how you are defining the source and destination for the move corresponding?
Back to top
View user's profile Send private message
Jonnala

New User


Joined: 22 Sep 2006
Posts: 12

PostPosted: Tue May 22, 2007 4:20 pm
Reply with quote

Hi,

For example...

My Source Copybook contains below fields,

01 INPUT-REC.
02 VAR1.
05 VAR3 PIC XX.
05 VAR4 PIC XX.
05 VAR5 PIC XX.
02 VAR 6.
05 VAR7 PIC S9(7)V99 COMP-3.
05 VAR8 PIC X.
05 VAR9 PIC S9(7) COMP-3.

Destination Copybook contains below fields,

01 OUTPUT-REC.
02 VAR1.
05 VAR3 PIC XX.
05 VAR4 PIC XX.
05 VAR5 PIC XX.
02 VAR 6.
05 VAR7 PIC S9(7)V99.
05 VAR8 PIC X.
05 VAR9 PIC S9(7).

In Procudere Division,

MOVE CORR INPUT-REC TO OUTPUT-REC.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue May 22, 2007 5:26 pm
Reply with quote

Looks reasonable, where are "INPUT-REC" and "OUTPUT-REC" defined, FD or WS?
Is there any additional information with the S0C4?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 22, 2007 7:07 pm
Reply with quote

Hello,

Does this program only have the 2 file definitions, reads/writes, and the move corr?

I would not expect that to cause an 0c4.

Are you by chance using an internal sort in the program?
Back to top
View user's profile Send private message
Jonnala

New User


Joined: 22 Sep 2006
Posts: 12

PostPosted: Tue May 22, 2007 7:25 pm
Reply with quote

Yes Dick,

My program have only 2 file definitions (one for Input file and other for Output file), Read the Input file, Move Corr to Output file rec and write Output file. This is all my program does.

It doesnot contain any internal SORT.

William,

INPUT-REC & OUTPUT-REC are defined in FD.

This is message displayed in SYSOUT.
"CEE3204S The system detected a protection exception (System Completion Code=0C4).
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue May 22, 2007 9:00 pm
Reply with quote

Splurge a little, post the COBOL code......
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed May 23, 2007 12:40 am
Reply with quote

Hello,

Posting the code would be helpful.

This is a stand-alone batch job run thru jcl?

Does it abend right away or after some amount of data has been processed (if you specify (,catlg,catlg) for the output file, you can see how far it processed before abending).
Back to top
View user's profile Send private message
Jonnala

New User


Joined: 22 Sep 2006
Posts: 12

PostPosted: Fri May 25, 2007 12:14 pm
Reply with quote

HI,

My Prgram is ,

Code:
IDENTIFICATION DIVISION.                         
PROGRAM-ID. PRGPD2ZD.                           
                                                 
ENVIRONMENT DIVISION.                           
CONFIGURATION SECTION.                           
SOURCE-COMPUTER. IBM-370.                       
OBJECT-COMPUTER. IBM-370.                       
INPUT-OUTPUT SECTION.                           
FILE-CONTROL.                                   
    SELECT EPAY-IN             ASSIGN TO EPAYIN.
    SELECT EPAY-OUT            ASSIGN TO EPAYOUT.
                                                 
DATA DIVISION.                                   
FILE SECTION.                                   
                                                 
FD  EPAY-IN                                     
    RECORDING MODE IS F                         
    LABEL RECORDS ARE STANDARD.                 
COPY CFEUNETB.                                   

FD  EPAY-OUT                     
    RECORDING MODE IS V         
    LABEL RECORDS ARE STANDARD. 
COPY SRISCOPY.                   
                                 
WORKING-STORAGE SECTION.         
77 EOF PIC X VALUE 'N'.         
                                 
PROCEDURE DIVISION.             
1000-MAIN-PARA.                 
    OPEN INPUT EPAY-IN           
         OUTPUT EPAY-OUT.       
    PERFORM 2000-READ-PARA       
                 UNTIL EOF = 'Y'.
    IF EOF NOT = 'Y'             
       PERFORM 2100-WRITE-PARA   
    END-IF                       
    CLOSE EPAY-IN                       
          EPAY-OUT.                     
    STOP RUN.                           
                                       
                                       
2000-READ-PARA.                         
    READ EPAY-IN                       
         AT END MOVE 'Y' TO EOF.       
                                       
2100-WRITE-PARA.                       
    MOVE CORR TOPS-EXTRACT-EMPLOYEE-INFO
              TO EPAY-OUT-REC.         
    WRITE EPAY-OUT-REC.                 


Copybook 'CFEUNETB' is of lenth 5609 bytes, contains some Comp-3 fields. Copybook 'SRISCOPY' is just a copy of 'CFEUNETB', where all Comp-3 fields are defined as Normal ZD fields.

My JCL is:

//TSUA6UIS JOB ('META0102'),CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID
//*
//JOBLIB DD DSN=TSUA6UI.LOAD,DISP=SHR
//STEP1 EXEC PGM=PRGPD2ZD
//SYSOUT DD SYSOUT=*
//EPAYIN DD DSN=TSUA6UI.EMPCORE.DATA,DISP=SHR
//EPAYOUT DD DSN=TSUA6UI.EMPCORE.DATA1,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(10,3),RLSE)
/*


It got abended right away, I mean no data has been processed.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri May 25, 2007 3:48 pm
Reply with quote

Code works better than color.
Why did the recfm change from fixed to variable?
Stick a display in after the open and before the perform to see if you survived the open.
Your program logic is slightly lacking, try it this way:
Code:
    display 'every thing opened OK'
    PERFORM UNTIL EOF = 'Y'
       perform 2000-READ-PARA       
       IF EOF NOT = 'Y'             
          PERFORM 2100-WRITE-PARA   
       END-IF                       
    end-perform.
Back to top
View user's profile Send private message
Jonnala

New User


Joined: 22 Sep 2006
Posts: 12

PostPosted: Fri May 25, 2007 7:54 pm
Reply with quote

Thanks a lot William for correcting me.

I have put a DISPLAY Statement after OPENing the files.
However, the DISPLAY Statement is not execueted. There is no message from program in SYSOUT.

Still am getting the same '0C4' abend.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri May 25, 2007 8:14 pm
Reply with quote

Why did the recfm change from fixed input to variable output?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 25, 2007 9:35 pm
Reply with quote

Hello,

As an experiment, please add another DISPLAY 'ENTERING PROCEDURE DIVISION' as the first statement in the procedure division. Follow that DISPLAY with a few DISPLAY ' ' statements. If this display is not in sysout, you may have a problem with how the module was link edited.

You might look at the output of the compile for any warnings - things that are not an error may still cause run-time problems.

After your job executes, look at each of the jes outputs and see if there is any diagnostic information.
Back to top
View user's profile Send private message
Jonnala

New User


Joined: 22 Sep 2006
Posts: 12

PostPosted: Mon May 28, 2007 12:09 pm
Reply with quote

Hi,

I have done slight modifications to my code in Procudure division.

Code:
PROCEDURE DIVISION.                         
    DISPLAY "ENTERED INTO PROC DIV".       
1000-MAIN-PARA.                             
    DISPLAY "ENTERED INTO 1000 PARA"       
    OPEN INPUT EPAY-IN                     
         OUTPUT EPAY-OUT                   
    DISPLAY "FILES ARE OPENED FINE"         
    PERFORM 2000-PARA                       
            UNTIL EOF = 'Y'     
    CLOSE EPAY-IN               
          EPAY-OUT             
    STOP RUN.                   
                               
2000-PARA.                     
    READ EPAY-IN               
         AT END MOVE 'Y' TO EOF
    IF EOF NOT = 'Y'           
       MOVE CORR EPAY-IN-REC   
                 TO EPAY-OUT-REC
       WRITE EPAY-OUT-REC       
    END-IF.


Am getting ENTERED INTO 1000 PARA in SYSOUT, but not FILES ARE OPENED FINE.
Is there any error in Opening the files?? I cant see file opening errors in my SPOOL.

Willaim,
Now the recfm is fixed for both Files.

There are some warning messages in Compile listing, Can these be ignored??

Code:
IGYDS1073-I   "CS-EE-PROVIDER-INFO" redefined a larger item.           
                                                                       
IGYPS2168-W   "CORRESPONDING" was specified, but subordinate item "CS-EE-PROVIDER-INFO" within "EPAY-IN-REC" did not qualify
              according to the rules for the "CORRESPONDING" phrase.  Subordinate item "CS-EE-PROVIDER-INFO" was ignored.   
                                                                       
IGYPS2168-W   "CORRESPONDING" was specified, but subordinate item "CS-EE-EOB-COPY-INFO" within "EPAY-IN-REC" did not qualify
              according to the rules for the "CORRESPONDING" phrase.  Subordinate item "CS-EE-EOB-COPY-INFO" was ignored.   
                                                                       
IGYPS2168-W   "CORRESPONDING" was specified, but subordinate item "FILLER" within "EPAY-IN-REC" did not qualify according to
              the rules for the "CORRESPONDING" phrase.  Subordinate item "FILLER" was ignored.
                                                                       
              Same message on line:   1158   1158   1158   1158   1158  1158   1158   1158   1158   1158   1158
                                                                       
IGYPS2168-W   "CORRESPONDING" was specified, but subordinate item "CS-EE-SUBL-TABLE" within "EPAY-IN-REC" did not qualify
              according to the rules for the "CORRESPONDING" phrase.  Subordinate item "CS-EE-SUBL-TABLE" was ignored. 

IGYPS2168-W   "CORRESPONDING" was specified, but subordinate item "CS-EE-LINE-DATA-INFO" within "EPAY-IN-REC" did not
              qualify according to the rules for the "CORRESPONDING" phrase.  Subordinate item "CS-EE-LINE-DATA-INFO" was
              ignored.                                                 
                                                                       
IGYPS2168-W   "CORRESPONDING" was specified, but subordinate item "CS-EE-PROV-DATA-AREA-2" within "EPAY-IN-REC" did not   
              qualify according to the rules for the "CORRESPONDING" phrase.  Subordinate item "CS-EE-PROV-DATA-AREA-2" was
              ignored.                                                 
                                                                       
IGYPS2168-W   "CORRESPONDING" was specified, but subordinate item "CS-EE-MODIFIER-DATA" within "EPAY-IN-REC" did not qualify
              according to the rules for the "CORRESPONDING" phrase.  Subordinate item "CS-EE-MODIFIER-DATA" was ignored.
                                                                       
IGYPS2168-W   "CORRESPONDING" was specified, but subordinate item "CS-EE-UB92-DATA" within "EPAY-IN-REC" did not qualify
              according to the rules for the "CORRESPONDING" phrase.  Subordinate item "CS-EE-UB92-DATA" was ignored.
                                                                       
IGYOP3091-W   Code from "MOVE (line 1158.01)" to "WRITE (line 1160.01)" can never be executed and was therefore discarded.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon May 28, 2007 12:22 pm
Reply with quote

Quote:
Is there any error in Opening the files?? I cant see file opening errors in my SPOOL.

You have not used file status in the program. Please put that and see whether files are being opened correctly or not.

Quote:
There are some warning messages in Compile listing, Can these be ignored??


Gnerally yes. Could you post the working storage declartions alos for better picture of the compilation errors?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon May 28, 2007 4:20 pm
Reply with quote

Hello,

You are missing periods at multiple places in the code - this should not cause an 0c4, but should be corrected.

What messages are in the output from the link edit? The link edit does specify the correct module name(s)?

If the 0c4 is raised on the open, i doubt that the file-status check/display will be executed.

Please split the open into 2 separate statements and issue a DISPLAY after each.
Back to top
View user's profile Send private message
Jonnala

New User


Joined: 22 Sep 2006
Posts: 12

PostPosted: Mon May 28, 2007 6:59 pm
Reply with quote

Hello,

0C4 problem has been solved. It was the problem while Link editing.

However,
Code:
MOVE CORR EPAY-IN-REC     
          TO EPAY-OUT-REC

is not working. It is generating 0C7 now.

Just tried movind with out CORR. All the records have been copied to output file, but Packed Fields in the input file are generated unintended values in the output file.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon May 28, 2007 10:54 pm
Reply with quote

Hello,

If you are getting an s0c7, most likely either the data is invalid or the input record layout is invalid.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue May 29, 2007 12:23 pm
Reply with quote

Jonnala,

Before writing to output, initialize the output record. Try to use below code, it should work.

Code:
2100-WRITE-PARA.
    INITIALIZE EPAY-OUT-REC.
    MOVE CORR TOPS-EXTRACT-EMPLOYEE-INFO
              TO EPAY-OUT-REC.         
    WRITE EPAY-OUT-REC.   


Please let me know the results.
Back to top
View user's profile Send private message
Jonnala

New User


Joined: 22 Sep 2006
Posts: 12

PostPosted: Tue May 29, 2007 6:48 pm
Reply with quote

Hi Anuj, No change in the result.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 29, 2007 7:11 pm
Reply with quote

Hello,

Initializing the receiving area for a move will not correct an 0c7 when there is bad input data to the move.

Please check the contents of each field against the "sending" data layout.
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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top