checking line feed using jcl



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

checking line feed using jcl

Postby KEN » Thu Apr 29, 2010 4:43 pm

Hi,

i am using the below jcl to convert ascii file to ebcdic file. But i want to perform check on the line feed also.

can i do it using the jcl?

//STEP01 EXEC PGM=IKJEFT01,REGION=512K
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//ASCIN DD DSN=ascii dataset,DISP=SHR
//EBCOUT DD DSN=ebcdic dataset,
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(168,25),RLSE),
//SYSTSIN DD *
OCOPY INDD(ASCIN) OUTDD(EBCOUT) CONVERT((BPXFX311)) TO1047
/*

regards,
Ken
KEN
 
Posts: 7
Joined: Tue Apr 27, 2010 4:35 pm
Has thanked: 0 time
Been thanked: 0 time

Re: checking line feed using jcl

Postby MrSpock » Thu Apr 29, 2010 4:51 pm

What exactly is it that you want to do with it? I've had to write my own process to handle CR/LF conditions on data that I receive from a TCP/IP Socket call.
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: checking line feed using jcl

Postby Robert Sample » Thu Apr 29, 2010 4:55 pm

But i want to perform check on the line feed also.
What does this mean?
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: checking line feed using jcl

Postby KEN » Thu Apr 29, 2010 5:02 pm

I am having a ASCII file . I have to check if the last two bytes in the file contains X'0D0A' . if yes, then i want to convert the whole file into EBCDIC format. The below jcl converts the ascii file to ebcdic but it doesnot perform the check on last two bytes of the file.

//STEP01 EXEC PGM=IKJEFT01,REGION=512K
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//ASCIN DD DSN=ascii dataset,DISP=SHR
//EBCOUT DD DSN=ebcdic dataset,
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(168,25),RLSE),
//SYSTSIN DD *
OCOPY INDD(ASCIN) OUTDD(EBCOUT) CONVERT((BPXFX311)) TO1047
/*

i want to modify this jcl to perform the check first and then do the conversion from ASCII to EBCDIC.

REGARDS,
KEN
KEN
 
Posts: 7
Joined: Tue Apr 27, 2010 4:35 pm
Has thanked: 0 time
Been thanked: 0 time

Re: checking line feed using jcl

Postby dick scherrer » Fri Apr 30, 2010 3:11 am

Hello,

What should happen if the "last two bytes in the file" does not contain X'0D0A'?

One easy way to do what you want is to add a step before this step to read the file, check the last 2 bytes of data and set a retuen-code depending on whether the value was found or not.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: checking line feed using jcl

Postby KEN » Tue May 04, 2010 5:30 pm

Thanks dick!

The input ASCII file is having the header and the trailer which donot contain X'0D0A' in the last two bytes.
i want to check if all the lines(except header and trailer)in the input file contains X'0D0A' or not.

The below jcl converts the ASCII file to EBCDIC but it doesnot perform the above check.

//STEP01 EXEC PGM=IKJEFT01,REGION=512K
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//ASCIN DD DSN=ascii dataset,DISP=SHR
//EBCOUT DD DSN=ebcdic dataset,
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(168,25),RLSE),
//SYSTSIN DD *
OCOPY INDD(ASCIN) OUTDD(EBCOUT) CONVERT((BPXFX311)) TO1047
/*

can i modify this jcl to produce the EBCDIC file only if the above condition is satisified, else not.


thanks in advance,

regards,
ken
KEN
 
Posts: 7
Joined: Tue Apr 27, 2010 4:35 pm
Has thanked: 0 time
Been thanked: 0 time

Re: checking line feed using jcl

Postby Robert Sample » Tue May 04, 2010 5:45 pm

You will have to write a program to do this check. It would be wise to write the program to run on whatever machine is sending the data to the mainframe.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post