I have DATE filed like DD-MM-YYYY, So I want output should be
MM/DD/YYYY using JCL?

Can anybody post the answer for above requirement?




Answers were Sorted based on User's Feedback



I have DATE filed like DD-MM-YYYY, So I want output should be MM/DD/YYYY using JCL? Can anybody..

Answer / harsha

12345678910
DD-MM-YYYY
Above is the date and column numbers.

//STEP1 EXEC PGM=SORT
// .
// .
// .
OPTION COPY
OUTFILE FNAMES=SORTOUT
OUTREC=(4,2,C'/',1,2,C'/',7,4)

Is This Answer Correct ?    14 Yes 1 No

I have DATE filed like DD-MM-YYYY, So I want output should be MM/DD/YYYY using JCL? Can anybody..

Answer / mfgan

When DD-MM-YYYY is the first field of input record,
Then use the below code,

//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,2,
3:C'/',
4:4,2,
6:C'/',
7:7,4)
/*
//
When others,
Change the position numbers occordingly.

Is This Answer Correct ?    2 Yes 0 No

I have DATE filed like DD-MM-YYYY, So I want output should be MM/DD/YYYY using JCL? Can anybody..

Answer / raghuvanshi

When I am using
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(4,2,C'/',1,2,C'/',7,4)
/*
//

I am getting the same output as input!
Can someone please through some light on it.

Is This Answer Correct ?    1 Yes 1 No




I have DATE filed like DD-MM-YYYY, So I want output should be MM/DD/YYYY using JCL? Can anybody..

Answer / pranay

OUTREC FIELDS=(4,2,C'/',1,2,C'/',7,4)

The above Sort card is working perfectly fine for me.
Please recheck.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer



More JCL Interview Questions

what are the various stages of job processing?

0 Answers   IBM,


how can i use the parameters decalred in main pgm in sub pgm

2 Answers   TCS,


what is “Cond= even” and “Cond=only”?

0 Answers  


What do you feel makes a good program?

1 Answers  


How does -818 sql error occur? Why does it happen and what can be done to overcome this error code?

5 Answers   RBS,






I am getting the file from Unix to Mainframes for every 15 minutes. The mainframe job get abended with bad records coming from unix. I recovered that by deleting the bad data. I need permenant solution how to fix the issue? The record is getting characters in in first 9 positions which it should not. Please provide me the solution how to skip the records if it finds the charcters in the first 9 positions. K

3 Answers  


How is the keyword DUMMY used in JCL?

4 Answers  


Explain concatenating datasets?

2 Answers   CTS,


I want to JCL sort for Non-COMP and COMP-3 fields SORT FIELDS=(1,5,A,6,11,A,12,11,A,19,1,A,20,1,A),FORMAT=BI,EQUALS Length of comp bytes is 11 bytes which start at 6byte and 12 byte considering 11 bytes in comp-3 is 6 bytes. Can anyone tell if the above sort work SORT FIELDS=(1,5,A,6,6,A,12,6,A,19,1,A,20,1,A),FORMAT=BI,EQUALS does not works OK

0 Answers   IBM,


i have a string of 80 chars i want to replace 4th char with "a"?

3 Answers   CSC,


how you will the direct the data to spool using sysout option?

0 Answers   IBM,


Suppose there are 10 steps in a PROC, I want to execute only step5. How do you give the condition in the JCL that calls this PROC?

3 Answers   IBM,






Categories