File Processing



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

File Processing

Postby eprasad629 » Thu May 07, 2009 2:52 pm

Hi,

I have written a db2 program to read a file, access database and write a report. I have designed 2 input files. 1 an ordinary PS file and the other a GDG version.

I'm able to view the output when my program processes PS file. However when GDG file is processed, SQL queries are giving a sqlcode +100 (End of Data reached)

Both the PS file and the GDG are having the same file format, RECL and profile.

Could you please help me out in sorting this problem?

Regards,
Praelay.
Thanks & Regards,

Praelay
--------------------------------
eprasad629
 
Posts: 34
Joined: Wed Jan 07, 2009 12:48 pm
Location: Bangalore
Has thanked: 0 time
Been thanked: 0 time

Re: File Processing

 

Re: File Processing

Postby swd » Thu May 07, 2009 5:18 pm

Could you post your JCL for us to have a look at ?

Cheers
Steve
User avatar
swd
 
Posts: 109
Joined: Wed Feb 18, 2009 9:18 pm
Location: UK
Has thanked: 0 time
Been thanked: 0 time

Re: File Processing

Postby dick scherrer » Thu May 07, 2009 11:57 pm

Hello,

Both the PS file and the GDG are having the same file format, RECL and profile.
Have you verified the content is the same? How was the data written into these 2 files?

As Steve mentioned, seeign your jcl may help - post the jcl that created the files as well as the jcl for the problem step.

Suggest you post the firwst few records from each file with HEX ON (use copy/paste, and the "Code" tag for readability. Use Preview to see your post as it will appear to the forum and Submit when you are satisfied with the appearance of the post.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: File Processing

Postby eprasad629 » Sat May 09, 2009 11:24 am

Hi Steve & Scherrer,

Thanks a lot for your reply.

As advised, I'm posting the JCL and the input files. Only GDG version is created through JCL and not the PS file.

GDG File
------------------------------------------------------------------------------
000002 XZEE940024      ,             ,             ,             ,             
       CECCFFFFFF44444464444444444444644444444444446444444444444464444444444444
       2355940024000000B0000000000000B0000000000000B0000000000000B0000000000000
------------------------------------------------------------------------------
000003 XZEE940033      ,             ,             ,             ,             
       CECCFFFFFF44444464444444444444644444444444446444444444444464444444444444
       2355940033000000B0000000000000B0000000000000B0000000000000B0000000000000
------------------------------------------------------------------------------
000004 XZ/BM400335/A   ,             ,             ,             ,             
       CE6CDFFFFFF6C44464444444444444644444444444446444444444444464444444444444
       2312440033511000B0000000000000B0000000000000B0000000000000B0000000000000
------------------------------------------------------------------------------


PS File
------------------------------------------------------------------------------
000200 XZEE940024      ,             ,             ,             ,             
       CECCFFFFFF44444464444444444444644444444444446444444444444464444444444444
       2355940024000000B0000000000000B0000000000000B0000000000000B0000000000000
------------------------------------------------------------------------------
000300 XZEE940033      ,             ,             ,             ,             
       CECCFFFFFF44444464444444444444644444444444446444444444444464444444444444
       2355940033000000B0000000000000B0000000000000B0000000000000B0000000000000
------------------------------------------------------------------------------
000400 XZ/BM400335/A   ,             ,             ,             ,             
       CE6CDFFFFFF6C44464444444444444644444444444446444444444444464444444444444
       2312440033511000B0000000000000B0000000000000B0000000000000B0000000000000


JCL

//SPRNT62R JOB A1000000,'PROG 02',
// NOTIFY=&SYSUID,
// MSGLEVEL=(1,1),MSGCLASS=Q,
// REGION=4999K,
// CLASS=A
/*
/*JOBPARM LINES=9999
//**********************************************************************
//STEP010  EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
LISTCAT ENT('PHOBOS1.TR2.TXT')
IF MAXCC=0 THEN SET MAXCC=0
IF MAXCC=4 THEN SET MAXCC=3
/*
//**********************************************************************
//SORTCOPY EXEC  PGM=ICEMAN,COND=(0,NE,STEP010)
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD DSN=PHOBOS1.SPRINT4.TXT,DISP=SHR
//SORTOUT  DD DSN=PHOBOS1.R1100.TXT.BACKUP(+1),
//            DISP=(NEW,CATLG,CATLG),
//            UNIT=SYSDA,SPACE=(CYL,(20,50),RLSE),
//            DCB=(BLKSIZE=6233,RECFM=VB,DSORG=PS,LRECL=256)
//SYSIN    DD    *
OPTION COPY
/*
//*
//**********************************************************************
//SORTVTOF EXEC  PGM=ICEMAN,COND=(0,NE,STEP010)
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD DSN=PHOBOS1.R1100.TXT.BACKUP(+1),DISP=SHR
//SORTOUT  DD DSN=PHOBOS1.R1100.INPUT(+1),
//            DISP=(NEW,CATLG,CATLG),
//            UNIT=SYSDA,SPACE=(CYL,(20,50),RLSE),
//            DCB=(BLKSIZE=800,RECFM=FB,DSORG=PS,LRECL=80)
//SYSIN    DD    *
OPTION COPY
OUTFIL VTOF,BUILD=(5,80)
/*
//*
//* THIS GDG VERSION DOES RETURNED +100 FOR EVERY SQLCODE
//**********************************************************************
//GDGFILE1 EXEC PGM=IKJEFT01,COND=(0,NE,STEP010)
//STEPLIB    DD DSN=SYSD0.DB2.DSN2.SDSNLOAD,DISP=SHR
//           DD DSN=SYSD0.DB2.DSN2.SDSNEXIT,DISP=SHR
//SYSPRINT DD SYSOUT=Q
//SYSDBOUT DD SYSOUT=Q
//SYSUDUMP DD SYSOUT=Q
//ABNLDUMP DD SYSOUT=Q
//ABNLHELP DD SYSOUT=Q
//ABNLALL  DD SYSOUT=Q
//ABNLWSPT DD SYSOUT=Q
//SYSPUNCH DD SYSOUT=Q
//SYSOUT   DD SYSOUT=Q
//SYSTSPRT DD SYSOUT=Q
//VIOCTL   DD DSN=ACTIVATE,DISP=SHR,VOL=REF=SYS1.LINKLIB,AMP='AMORG'
//R11S41   DD DSN=PHOBOS1.R1100.INPUT(+1),DISP=SHR
//R11SOP1  DD DSN=PHOBOS1.R1100.REPORT(+1),
//            DISP=(NEW,CATLG,CATLG),
//            UNIT=SYSDA,SPACE=(CYL,(20,50),RLSE),
//            DCB=(BLKSIZE=800,RECFM=FB,DSORG=PS,LRECL=80)
//SYSTSIN  DD *
DSN SYSTEM (DSN2)
RUN PROG (QWERTV08)  -
PLAN (QWERT304)      -
LIB ('HOBOSC2.BATCH.LOAD')
END
/*
//* THIS PS FILE DOES RETURNED EXPECTED OUTPUT
//**********************************************************************
//PSFILE02 EXEC PGM=IKJEFT01,COND=(0,NE,STEP010)
//STEPLIB    DD DSN=SYSD0.DB2.DSN2.SDSNLOAD,DISP=SHR
//           DD DSN=SYSD0.DB2.DSN2.SDSNEXIT,DISP=SHR
//SYSPRINT DD SYSOUT=Q
//SYSDBOUT DD SYSOUT=Q
//SYSUDUMP DD SYSOUT=Q
//ABNLDUMP DD SYSOUT=Q
//ABNLHELP DD SYSOUT=Q
//ABNLALL  DD SYSOUT=Q
//ABNLWSPT DD SYSOUT=Q
//SYSPUNCH DD SYSOUT=Q
//SYSOUT   DD SYSOUT=Q
//SYSTSPRT DD SYSOUT=Q
//VIOCTL   DD DSN=ACTIVATE,DISP=SHR,VOL=REF=SYS1.LINKLIB,AMP='AMORG'
//R11S41   DD DSN=PHOBOS1.LOGS.TXT,DISP=SHR
//R11SOP1  DD DSN=PHOBOS1.LOGS.REPORT,DISP=SHR
//SYSTSIN  DD *
DSN SYSTEM (DSN2)
RUN PROG (QWERTV08)  -
PLAN (QWERT304)      -
LIB ('HOBOSC2.BATCH.LOAD')
END
/*


The contents of the PS file and GDG file are also same along with the file parameters.

Kinldy let me know in case if you require further information on this.

Many thanks in advance.

Regards,
Praelay.
Thanks & Regards,

Praelay
--------------------------------
eprasad629
 
Posts: 34
Joined: Wed Jan 07, 2009 12:48 pm
Location: Bangalore
Has thanked: 0 time
Been thanked: 0 time

Re: File Processing

Postby dick scherrer » Sat May 09, 2009 11:57 am

Hello,

Why are there 2 iceman copy steps?
Only GDG version is created through JCL and not the PS file.
How is the PS file created?

Does the problem run (the one with the +100) have a returncode other than zeros?

Please post the informational output from all of the ICEMAN steps and the IKJEFT01. What does the IDCAMS step010 do for this job?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: File Processing

Postby eprasad629 » Sat May 09, 2009 3:43 pm

Hi Scherrer,

I upload the input file using FTP process. The file format is VB.

2 Iceman steps are used for following,

1. VB(256) --> FB(256) this remains as backup of input data
2. FB(256) --> FB(80) as my program reads a FB file with LRECL 80.

PS File was created manually by copying the data from the FTPed input file using CUT & PASTE.

Problem run doesn't returns SQLCODE other than +100.

N.B
By the way, the program splits the input data using STRING function. Once I add the END-STRING which I have forgot to add, I got the desired output in GDG version too.

I don't know why the compiler doesn't throw a error during compilation also how the output came for PS file before that time.

Regards,
Praelay.
Thanks & Regards,

Praelay
--------------------------------
eprasad629
 
Posts: 34
Joined: Wed Jan 07, 2009 12:48 pm
Location: Bangalore
Has thanked: 0 time
Been thanked: 0 time

Re: File Processing

Postby dick scherrer » Sat May 09, 2009 10:33 pm

Hello,

There is no "rule" that end-string be used. What probably happened is that the code was not executing exactly the instructions you intended.

Good to hear it is working - thanks for letting us know :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post